Option Explicit

' ======================================================================
' Public
' ======================================================================

' 将一个基础数据类型数组转换成 [数组元素:数组索引] 形式的 map 对象
' @param arr 原始数组
' @return Scripting.Dictionary 对象
Public Function arrayToValAndIndexMap(ByRef arr As Variant) As Object
    Set arrayToValAndIndexMap = CreateObject("Scripting.Dictionary")

    Dim i As Integer
    Dim v As Variant
    For i = 0 To UBound(arr)
        v = arr(i)
        If Not arrayToValAndIndexMap.Exists(v) Then
            arrayToValAndIndexMap.Add v, i
        End If
    Next
End Function

'-----------------------------------------
' 计算数组切片使用到的信息
'-----------------------------------------
' 计算创建数组切片时需要使用到的信息
' @param originSize 原始数组的长度
' @optional-param start 起始位置
' @optional-param stop 终止位置(最终不会包含 stop 的索引)
' @optional-param step 步长，默认 = 1
'                       但是不能是 0，如果设置了 0 将会抛出异常
' @return Long() 数组，Long(0)=起始索引, Long(1)=结束索引, Long(2)=步长, Long(3)=切片的长度
Public Function computeArraySliceInfo(ByRef originSize As Long, _
    Optional ByRef startIdx As Variant, _
    Optional ByRef stopIdx As Variant, _
    Optional ByRef step As Variant = 1 _
    ) As Variant

    ' 1. step 是否是 0
    If step = 0 Then
        Err.Raise 39999, Description:="UtilsArray.computeArraySliceInfo: slice's step must be not Zero!!!"
        Exit Function
    End If

    Dim result(0 To 3) As Long

    ' 2. 如果原始数据对象中还没有数据，则立刻终止
    If originSize = 0 Then
        Exit Function
    End If

    ' 3. 确定起始索引
    Dim realStartIdx As Long
    If IsError(startIdx) Then
        ' 如果没有设置起始索引，则根据 step 的符号确定
        ' step=正数，无穷小
        ' step=负数，无穷大
        If step > 0 Then
            realStartIdx = 0
        Else
            realStartIdx = originSize - 1
        End If
    Else
        ' 如果设置了索引则直接使用
        realStartIdx = Int(startIdx)

        ' 对索引进行第一次纠正
        If realStartIdx < 0 Then
            ' 如果索引是负数: 负数变正数 = 长度 + 索引值
            realStartIdx = originSize + realStartIdx

            ' 如果索引还是负数（说明已经超过了数组索引范围），再次纠正索引，同向的起始边界需要设置到 0
            If realStartIdx < 0 Then
                If step > 0 Then
                    realStartIdx = 0
                End If
                ' 如果 step 是负数不需要纠正 start，因为最终一定不存在数据
            End If
        End If
    End If

    ' 4. 确定终止索引
    Dim realStopIdx As Long
    If IsError(stopIdx) Then
        ' 如果没有设置起始索引，则根据 step 的符号确定
        ' step=正数，无穷大
        ' step=负数，无穷小
        ' 因为 stop 位置的索引不包含，所以要向对应方向再多移动一位
        If step > 0 Then
            realStopIdx = originSize
        Else
            realStopIdx = -1
        End If
    Else
        ' 如果设置了索引则直接使用
        ' 无论 step 正负，stop 都需要 - 1
        realStopIdx = Int(stopIdx)

        ' 对索引进行第一次纠正
        If realStopIdx < 0 Then
            ' 如果索引是负数: 负数变正数 = 长度 + 索引值
            realStopIdx = originSize + realStopIdx

            If realStopIdx < 0 Then
                If step < 0 Then
                    ' 因为 stop 的边界不包含，索引需要移动到 -1
                    realStopIdx = -1
                End If
            End If
        End If
    End If

    ' 快速结束
    '     特殊处理: start + stop 同时 >= originSize，则默认没有容量为 0
    If realStartIdx >= originSize And realStopIdx >= originSize Then
        result(0) = -1
        result(1) = -1
        result(2) = 1
        result(3) = 0

        computeArraySliceInfo = result
        Exit Function
    End If

    ' 将超过范围的索引(超过了最大范围的右侧)重新校正回来
    If realStartIdx >= originSize Then
        ' 如果索引超过了数据数量的最大值，则定位到最大索引位置
        realStartIdx = originSize - 1
    End If
    If realStopIdx > originSize Then
        ' 如果索引超过了数据数量的最大值，则定位到最大索引位置 + 1
        realStopIdx = originSize
    End If

    ' 5. 计算数据数量
    ' 计算方法: 1（第一个索引的值）+ 剩余的数量 / step
    Dim sliceSize As Long
    If step < 0 Then
        If realStartIdx <= realStopIdx Then
            ' 如果索引范围不正确，并且一定没有数据，则设置为 0
            sliceSize = 0
        Else
            sliceSize = Int(-1 * (realStartIdx - realStopIdx - 1) / step + 1)
        End If
    Else
        If realStartIdx >= realStopIdx Then
            sliceSize = 0
        Else
            sliceSize = Int((realStopIdx - realStartIdx - 1) / step + 1)
        End If
    End If

    ' 6. 如果切片长度小于 0，则定位到 0
    If sliceSize <= 0 Then
        sliceSize = 0
    End If

    ' 7. 保存结果
    ' Long(0)=起始索引, Long(1)=结束索引, Long(2)=步长,Long(3)=切片的长度
    result(0) = realStartIdx
    result(1) = realStopIdx
    result(2) = step
    result(3) = sliceSize

    computeArraySliceInfo = result
End Function


'-----------------------------------------
' 拷贝数组
'-----------------------------------------
' 拷贝数组
' @param src 原始数组
' @param srcPos 原始数组的起始索引
' @param desc 目标数组
' @param descPos 开始拷贝的起始索引
' @param length 需要拷贝的数据长度
Public Sub arrayCopy(ByRef src As Variant, ByRef srcPos As Integer, _
                    ByRef desc As Variant, ByRef descPos As Integer, _
                    ByRef length As Integer)
    Dim i As Integer
    For i = 0 To length - 1
On Error GoTo catch
        desc(descPos + i) = src(srcPos + i)
        Goto continue
catch:
        Err.Clear
        Set desc(descPos + i) = src(srcPos + i)
        Resume continue
continue:
    Next
End Sub

'-----------------------------------------
' 一维数组克隆
'-----------------------------------------
' 克隆一个一维数组
' @param origin 原始数组
' @return 克隆后的数组
'         因为无法设置类型，所以统一返回 Variant
Public Function clone1DArray(ByRef origin As Variant) As Variant
    Dim min As Integer
    Dim max As Integer
    min = LBound(origin)
    max = UBound(origin)

    ' 1. 初始化数组
    Dim result() As Variant
    ReDim result(min To max) As Variant

    ' 2. 如果数组长度为 0，则立刻结束
    Dim size As Integer
    size = max - min + 1
    If size = 0 Then
        clone1DArray = result
        Exit Function
    End If

    ' 3. 拷贝数据
    UtilsArray.arrayCopy origin, min, result, min, size

    clone1DArray = result
End Function

' 克隆一个一维数组
'
' 1. 当前方法专门用来处理前一个方法接受了 paramArray 参数并需要进行合并的情况, 如:
'
'   f(1,2,3,4)
'
'   Sub f(ParamArray ps() As Variant)
'       ' 调用该方法合并 ps，以使得 ps 可以作为参数进行传递
'       Dim result As Variant
'       result = UtilsArray.clone1DArrayForParamVal(ps)
'   End Sub
'
' 2. 克隆后的数组下标从 0 开始
'
' @param origin 原始数组（用来接收前一个方法的 paramArray 参数）
' @return 克隆后的数组
'         因为无法设置类型，所以统一返回 Variant
Public Function clone1DArrayForParamVal(ByVal origin As Variant) As Variant
    ' 不做任务处理 ParamArray 参数传入该方法时，系统已经完成了克隆，克隆后的数组下标从 0 开始
    clone1DArrayForParamVal = origin
End Function

' 克隆一个一维数组，并合并且他被提供的数据
' 被合并的数据将会按照顺序添加到新数组的末尾
' @param origin 原始数组
' @param-array otherParams 需要合并的其他数据（可选参数）
' @return 克隆后的数组
'         因为无法设置类型，所以统一返回 Variant
Public Function clone1DArrayAndMergeForParams(ByRef origin As Variant, ParamArray otherParams() As Variant) As Variant
    ' 1. 计算来两个数组的起始 + 结束索引，以及数组的长度
    ' 1.1 计算来原始数组的起始 + 结束索引，以及数组的长度
    Dim originMin As Integer
    Dim originMax As Integer
    Dim originSize As Integer
    originMin = LBound(origin)
    originMax = UBound(origin)
    originSize = originMax - originMin + 1

    ' 1.2 计算来附加数据数组的起始 + 结束索引，以及数组的长度
    '      不需要计算 othersMin, 默认是 0
    Dim othersMax As Integer
    Dim othersSize As Integer
    othersMax = UBound(otherParams)
    othersSize = othersMax + 1

    ' 1.3 计算新数组的长度
    Dim newSize As Integer
    newSize = originSize + othersSize

    ' 2. 初始化数组
    Dim result() As Variant
    ReDim result(originMin To (originMin + newSize - 1)) As Variant

    ' 3. 如果新数组长度为 0，则立刻结束
    If newSize = 0 Then
        clone1DArrayAndMergeForParams = result
        Exit Function
    End If

    ' 4. 拷贝原始数据
    If originSize <> 0 Then
        UtilsArray.arrayCopy origin, originMin, result, originMin, originSize
    End If

    ' 5. 拷贝需要合并的数据
    If othersSize <> 0 Then
        ' 5.1 计算再次拷贝的起始索引
        Dim i As Integer
        If originSize <> 0 Then
            i = originMin + originSize
        Else
            i = originMin
        End If

        ' 5.2 完成 others 的拷贝
        Dim j As Integer
        For j = 0 To othersMax
On Error GoTo catch
            result(i) = otherParams(j)
            Goto continue
catch:
            Err.Clear
            Set result(i) = otherParams(j)
            Resume continue
    continue:
            i = i + 1
        Next
    End If

    clone1DArrayAndMergeForParams = result
End Function

' 克隆一个一维数组，并合并且他被提供的数据
' 被合并的数据将会按照顺序添加到新数组的末尾
'
' 当前方法专门用来处理前一个方法接受了 paramArray 参数并需要进行合并的情况
' 如:
'   f(arr, 1,2,3,4)
'
'   Sub f(ByRef arr As Variant, ParamArray ps() As Variant)
'       Dim newArray As Variant
'       newArray = UtilsArray.clone1DArrayAndMergeForParamsVal(arr, ps)
'   End Sub
'
' @param origin 原始数组
' @param paramArrayVal 需要合并的其他数据（用来接收前一个方法的 paramArray 参数）
' @return 克隆后的数组
'         因为无法设置类型，所以统一返回 Variant
Public Function clone1DArrayAndMergeForParamsVal(ByRef origin As Variant, ByVal paramArrayVal As Variant) As Variant
    clone1DArrayAndMergeForParamsVal = UtilsArray.clone1DArrayAndMergeForArray(origin, paramArrayVal)
End Function

' 克隆一个一维数组 src，并将数组 other 合并到克隆后的数组中
' 被合并的数据将会按照顺序添加到新数组的末尾
'
' @param src 原始数组
' @param others 需要合并的数组
' @return 克隆后的数组
'         因为无法设置类型，所以统一返回 Variant
Public Function clone1DArrayAndMergeForArray(ByRef src As Variant, ByRef others As Variant) As Variant
    ' 1. 计算来两个数组的起始 + 结束索引，以及数组的长度
    ' 1.1 计算来原始数组的起始 + 结束索引，以及数组的长度
    Dim srcMin As Integer
    Dim srcMax As Integer
    Dim srcSize As Integer
    srcMin = LBound(src)
    srcMax = UBound(src)
    srcSize = srcMax - srcMin + 1

    ' 1.2 计算来附加数据数组的起始 + 结束索引，以及数组的长度
    Dim othersMin As Integer
    Dim othersMax As Integer
    Dim othersSize As Integer
    othersMin = LBound(others)
    othersMax = UBound(others)
    othersSize = othersMax - othersMin + 1

    ' 1.3 计算新数组的长度
    Dim newSize As Integer
    newSize = srcSize + othersSize

    ' 2. 初始化数组
    Dim result() As Variant
    ReDim result(srcMin To (srcMin + newSize - 1)) As Variant

    ' 3. 如果新数组长度为 0，则立刻结束
    If newSize = 0 Then
        clone1DArrayAndMergeForArray = result
        Exit Function
    End If

    ' 4. 拷贝原始数据
    If srcSize <> 0 Then
        UtilsArray.arrayCopy src, srcMin, result, srcMin, srcSize
    End If

    ' 5. 拷贝需要合并的数据
    If othersSize <> 0 Then
        UtilsArray.arrayCopy others, othersMin, result, srcMin + srcSize, othersSize
    End If

    clone1DArrayAndMergeForArray = result
End Function

'-----------------------------------------
' 一维数组字符串连接
'-----------------------------------------
' 用指定分隔符连接 数组 中的每个元素
' 如果某个元素是一个 Object 类型的对象，无法生成字符串，只会为这个对象写入一个空格
' @param c 数组（用来接收前一个方法的 paramArray 参数）
' @param delimiter 分隔符
' @return String
Public Function joinElemForParamsVal(ByVal c As Variant, ByVal delimiter As String) As String
    joinElemForParamsVal = joinElem(c, delimiter)
End Function

' 用指定分隔符连接 数组 中的每个元素
' 如果某个元素是一个 Object 类型的对象，无法生成字符串，只会为这个对象写入一个空格
' @param c 数组
' @param delimiter 分隔符
' @return String
Public Function joinElem(ByRef c As Variant, ByVal delimiter As String) As String
    Dim max As Integer
    Dim min As Integer
    max = UBound(c)
    min = LBound(c)

    If max - min + 1 = 0 Then
        joinElem = ""
        Exit Function
    End If

    Dim i As Integer
    For i = min To max - 1
        If IsObject(c(i)) Then
            joinElem = joinElem & " " & delimiter
        Else
            joinElem = joinElem & c(i) & delimiter
        End If
    Next

    If IsObject(c(max)) Then
        joinElem = joinElem & " "
    Else
        joinElem = joinElem & c(max)
    End If
End Function

'-----------------------------------------
' 创建多维数组
'-----------------------------------------
' 按照各维度长度数组创建多维数组
' ！！！最多支持 10 维矩阵 ！！！
' @param sizeArray 各维度长度的数组
' @return 指定维度数量及其大小的数组
Public Function createMultiDimensionArrayBySizeArray(ByRef sizeArray As Variant) As Variant()
    Dim min As Integer
    Dim max As Integer
    min = LBound(sizeArray)
    max = UBound(sizeArray)

    Dim deminsionCount As Integer
    deminsionCount = max - min + 1

    If deminsionCount = 0 Then
        Exit Function
    ElseIf deminsionCount = 1 Then
        ReDim createMultiDimensionArrayBySizeArray(0 To (sizeArray(min) - 1))
        Exit Function
    ElseIf deminsionCount = 2 Then
        ReDim createMultiDimensionArrayBySizeArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1))
        Exit Function
    ElseIf deminsionCount = 3 Then
        ReDim createMultiDimensionArrayBySizeArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1))
        Exit Function
    ElseIf deminsionCount = 4 Then
        ReDim createMultiDimensionArrayBySizeArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1))
        Exit Function
    ElseIf deminsionCount = 5 Then
        ReDim createMultiDimensionArrayBySizeArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1))
        Exit Function
    ElseIf deminsionCount = 6 Then
        ReDim createMultiDimensionArrayBySizeArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1), 0 To (sizeArray(min + 5) - 1))
        Exit Function
    ElseIf deminsionCount = 7 Then
        ReDim createMultiDimensionArrayBySizeArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1), 0 To (sizeArray(min + 5) - 1), 0 To (sizeArray(min + 6) - 1))
        Exit Function
    ElseIf deminsionCount = 8 Then
        ReDim createMultiDimensionArrayBySizeArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1), 0 To (sizeArray(min + 5) - 1), 0 To (sizeArray(min + 6) - 1), 0 To (sizeArray(min + 7) - 1))
        Exit Function
    ElseIf deminsionCount = 9 Then
        ReDim createMultiDimensionArrayBySizeArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1), 0 To (sizeArray(min + 5) - 1), 0 To (sizeArray(min + 6) - 1), 0 To (sizeArray(min + 7) - 1), 0 To (sizeArray(min + 8) - 1))
        Exit Function
    ElseIf deminsionCount = 10 Then
        ReDim createMultiDimensionArrayBySizeArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1), 0 To (sizeArray(min + 5) - 1), 0 To (sizeArray(min + 6) - 1), 0 To (sizeArray(min + 7) - 1), 0 To (sizeArray(min + 8) - 1), 0 To (sizeArray(min + 9) - 1))
        Exit Function
    End If
End Function

' 按照指定的个维度长度来创建多维数组
' ！！！最多支持 10 维矩阵 ！！！
' @param-array sizeArray 各维度的长度
' @return 指定维度数量及其大小的数组
Public Function createMultiDimensionArray(ParamArray sizeArray() As Variant) As Variant()
    Dim min As Integer
    Dim max As Integer
    min = LBound(sizeArray)
    max = UBound(sizeArray)

    Dim deminsionCount As Integer
    deminsionCount = max - min + 1

    If deminsionCount = 0 Then
        Exit Function
    ElseIf deminsionCount = 1 Then
        ReDim createMultiDimensionArray(0 To (sizeArray(min) - 1))
        Exit Function
    ElseIf deminsionCount = 2 Then
        ReDim createMultiDimensionArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1))
        Exit Function
    ElseIf deminsionCount = 3 Then
        ReDim createMultiDimensionArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1))
        Exit Function
    ElseIf deminsionCount = 4 Then
        ReDim createMultiDimensionArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1))
        Exit Function
    ElseIf deminsionCount = 5 Then
        ReDim createMultiDimensionArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1))
        Exit Function
    ElseIf deminsionCount = 6 Then
        ReDim createMultiDimensionArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1), 0 To (sizeArray(min + 5) - 1))
        Exit Function
    ElseIf deminsionCount = 7 Then
        ReDim createMultiDimensionArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1), 0 To (sizeArray(min + 5) - 1), 0 To (sizeArray(min + 6) - 1))
        Exit Function
    ElseIf deminsionCount = 8 Then
        ReDim createMultiDimensionArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1), 0 To (sizeArray(min + 5) - 1), 0 To (sizeArray(min + 6) - 1), 0 To (sizeArray(min + 7) - 1))
        Exit Function
    ElseIf deminsionCount = 9 Then
        ReDim createMultiDimensionArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1), 0 To (sizeArray(min + 5) - 1), 0 To (sizeArray(min + 6) - 1), 0 To (sizeArray(min + 7) - 1), 0 To (sizeArray(min + 8) - 1))
        Exit Function
    ElseIf deminsionCount = 10 Then
        ReDim createMultiDimensionArray(0 To (sizeArray(min) - 1), 0 To (sizeArray(min + 1) - 1), 0 To (sizeArray(min + 2) - 1), 0 To (sizeArray(min + 3) - 1), 0 To (sizeArray(min + 4) - 1), 0 To (sizeArray(min + 5) - 1), 0 To (sizeArray(min + 6) - 1), 0 To (sizeArray(min + 7) - 1), 0 To (sizeArray(min + 8) - 1), 0 To (sizeArray(min + 9) - 1))
        Exit Function
    End If
End Function

'-----------------------------------------
' 从多维数组中获取数据
'-----------------------------------------

'-----------------------------------------------------------------------
'-----------------------------------------------------------------------
'-----------------------------------------------------------------------
' 从多维数组中获取指定索引下的数据
' ！！！最多支持 10 维矩阵 ！！！
'
' 不会委托调用 getArrayValueByParamsVal 方法来处理，以防止 ParamArray 参数产生的复制行为
'
' @param arr 数据数组
' @param-array indexes 各维度的数据索引
' @return 指定索引下的数据
Public Function getArrayValueByParams(ByRef arr As Variant, ParamArray indexes() As Variant) As Variant
    Dim deminsionCount As Integer
    deminsionCount = UBound(indexes) + 1
    If deminsionCount = 1 Then
        ' 1 维
On Error GoTo catchD1:
        getArrayValueByParams = arr(indexes(0))
        Exit Function
catchD1:
        Set getArrayValueByParams = arr(indexes(0))
    ElseIf deminsionCount = 2 Then
        ' 2 维
On Error GoTo catchD2:
        getArrayValueByParams = arr(indexes(0), indexes(1))
        Exit Function
catchD2:
        Set getArrayValueByParams = arr(indexes(0), indexes(1))
    ElseIf deminsionCount = 3 Then
        ' 3 维
On Error GoTo catchD3:
        getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2))
        Exit Function
catchD3:
        Set getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2))
    ElseIf deminsionCount = 4 Then
        ' 4 维
On Error GoTo catchD4:
        getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3))
        Exit Function
catchD4:
        Set getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3))
    ElseIf deminsionCount = 5 Then
        ' 5 维
On Error GoTo catchD5:
        getArrayValueByParams = arr(indexes(0), indexes(01), indexes(2), indexes(3), indexes(4))
        Exit Function
catchD5:
        Set getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4))
    ElseIf deminsionCount = 6 Then
        ' 6 维
On Error GoTo catchD6:
        getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5))
        Exit Function
catchD6:
        Set getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5))
    ElseIf deminsionCount = 7 Then
        ' 7 维
On Error GoTo catchD7:
        getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6))
        Exit Function
catchD7:
        Set getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6))
    ElseIf deminsionCount = 8 Then
        ' 8 维
On Error GoTo catchD8:
        getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7))
        Exit Function
catchD8:
        Set getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7))
    ElseIf deminsionCount = 9 Then
        ' 9 维
On Error GoTo catchD9:
        getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8))
        Exit Function
catchD9:
        Set getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8))
    ElseIf deminsionCount = 10 Then
        ' 10 维
On Error GoTo catchD10:
        getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8), indexes(9))
        Exit Function
catchD10:
        Set getArrayValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8), indexes(9))
    End If
End Function

' 从多维数组中获取指定索引下的基础类型数据
' ！！！最多支持 10 维矩阵 ！！！
'
' 不会委托调用 getArrayPrimitiveValueByParamsVal 方法来处理，以防止 ParamArray 参数产生的复制行为
'
' @param arr 数据数组
' @param-array indexes 各维度的数据索引
' @return 指定索引下的数据
Public Function getArrayPrimitiveValueByParams(ByRef arr As Variant, ParamArray indexes() As Variant) As Variant
    Dim deminsionCount As Integer
    deminsionCount = UBound(indexes) + 1
    If deminsionCount = 1 Then
        ' 1 维
        getArrayPrimitiveValueByParams = arr(indexes(0))
    ElseIf deminsionCount = 2 Then
        ' 2 维
        getArrayPrimitiveValueByParams = arr(indexes(0), indexes(1))
    ElseIf deminsionCount = 3 Then
        ' 3 维
        getArrayPrimitiveValueByParams = arr(indexes(0), indexes(1), indexes(2))
    ElseIf deminsionCount = 4 Then
        ' 4 维
        getArrayPrimitiveValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3))
    ElseIf deminsionCount = 5 Then
        ' 5 维
        getArrayPrimitiveValueByParams = arr(indexes(0), indexes(01), indexes(2), indexes(3), indexes(4))
    ElseIf deminsionCount = 6 Then
        ' 6 维
        getArrayPrimitiveValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5))
    ElseIf deminsionCount = 7 Then
        ' 7 维
        getArrayPrimitiveValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6))
    ElseIf deminsionCount = 8 Then
        ' 8 维
        getArrayPrimitiveValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7))
    ElseIf deminsionCount = 9 Then
        ' 9 维
        getArrayPrimitiveValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8))
    ElseIf deminsionCount = 10 Then
        ' 10 维
        getArrayPrimitiveValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8), indexes(9))
    End If
End Function

' 从多维数组中获取指定索引下的对象类型数据
' ！！！最多支持 10 维矩阵 ！！！
'
' 不会委托调用 getArrayValueByParamsVal 方法来处理，以防止 ParamArray 参数产生的复制行为
'
' @param arr 数据数组
' @param-array indexes 各维度的数据索引
' @return 指定索引下的数据
Public Function getArrayObjValueByParams(ByRef arr As Variant, ParamArray indexes() As Variant) As Variant
    Dim deminsionCount As Integer
    deminsionCount = UBound(indexes) + 1
    If deminsionCount = 1 Then
        ' 1 维
On Error GoTo catchD1:
        Set getArrayObjValueByParams = arr(indexes(0))
        Exit Function
catchD1:
        If IsEmpty(arr(indexes(0))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 2 Then
        ' 2 维
On Error GoTo catchD2:
        Set getArrayObjValueByParams = arr(indexes(0), indexes(1))
        Exit Function
catchD2:
        If IsEmpty(arr(indexes(0), indexes(1))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 3 Then
        ' 3 维
On Error GoTo catchD3:
        Set getArrayObjValueByParams = arr(indexes(0), indexes(1), indexes(2))
        Exit Function
catchD3:
        If IsEmpty(arr(indexes(0), indexes(1), indexes(2))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 4 Then
        ' 4 维
On Error GoTo catchD4:
        Set getArrayObjValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3))
        Exit Function
catchD4:
        If IsEmpty(arr(indexes(0), indexes(1), indexes(2), indexes(3))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 5 Then
        ' 5 维
On Error GoTo catchD5:
        Set getArrayObjValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4))
        Exit Function
catchD5:
        If IsEmpty(arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 6 Then
        ' 6 维
On Error GoTo catchD6:
        Set getArrayObjValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5))
        Exit Function
catchD6:
        If IsEmpty(arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 7 Then
        ' 7 维
On Error GoTo catchD7:
        Set getArrayObjValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6))
        Exit Function
catchD7:
        If IsEmpty(arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 8 Then
        ' 8 维
On Error GoTo catchD8:
        Set getArrayObjValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7))
        Exit Function
catchD8:
        If IsEmpty(arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 9 Then
        ' 9 维
On Error GoTo catchD9:
        Set getArrayObjValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8))
        Exit Function
catchD9:
        If IsEmpty(arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 10 Then
        ' 10 维
On Error GoTo catchD10:
        Set getArrayObjValueByParams = arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8), indexes(9))
        Exit Function
catchD10:
        If IsEmpty(arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8), indexes(9))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    End If
End Function

'-----------------------------------------------------------------------
'-----------------------------------------------------------------------
'-----------------------------------------------------------------------
' 从多维数组中获取指定索引下的数据
' ！！！最多支持 10 维矩阵 ！！！
' 当前方法专门用来处理前一个方法接受了 paramArray 参数并需要获取数据的情况, 如:
'   f(arr, 1,2,3,4)
'
'   Sub f(ByRef arr As Variant, ParamArray ps() As Variant)
'       ' 调用该方法，以使得 ps 可以作为参数进行传递
'       Dim result As String
'       newArray = UtilsArray.getArrayValueByParamsVal(arr, ps)
'   End Sub
'
' @param arr 数据数组
' @param indexes 各维度的数据索引（用来接收前一个方法的 paramArray 参数）
' @return 指定索引下的数据
Public Function getArrayValueByParamsVal(ByRef arr As Variant, ByVal indexes As Variant) As Variant
On Error GoTo catch:
    getArrayValueByParamsVal = getArrayValueByIndexArray(arr, indexes)
    Exit Function
catch:
    Set getArrayValueByParamsVal = getArrayValueByIndexArray(arr, indexes)
End Function

' 从多维数组中获取指定索引下的基础类型数据
' ！！！最多支持 10 维矩阵 ！！！
' 当前方法专门用来处理前一个方法接受了 paramArray 参数并需要获取数据的情况, 如:
'   f(arr, 1,2,3,4)
'
'   Sub f(ByRef arr As Variant, ParamArray ps() As Variant)
'       ' 调用该方法，以使得 ps 可以作为参数进行传递
'       Dim result As String
'       newArray = UtilsArray.getArrayPrimitiveValueByParamsVal(arr, ps)
'   End Sub
'
' @param arr 数据数组
' @param indexes 各维度的数据索引（用来接收前一个方法的 paramArray 参数）
' @return 指定索引下的数据
Public Function getArrayPrimitiveValueByParamsVal(ByRef arr As Variant, ByVal indexes As Variant) As Variant
    getArrayPrimitiveValueByParamsVal = getArrayPrimitiveValueByIndexArray(arr, indexes)
End Function

' 从多维数组中获取指定索引下的对象类型数据
' ！！！最多支持 10 维矩阵 ！！！
' 当前方法专门用来处理前一个方法接受了 paramArray 参数并需要获取数据的情况, 如:
'   f(arr, 1,2,3,4)
'
'   Sub f(ByRef arr As Variant, ParamArray ps() As Variant)
'       ' 调用该方法，以使得 ps 可以作为参数进行传递
'       Dim result As String
'       newArray = UtilsArray.getArrayObjValueByParamsVal(arr, ps)
'   End Sub
'
' @param arr 数据数组
' @param indexes 各维度的数据索引（用来接收前一个方法的 paramArray 参数）
' @return 指定索引下的数据
Public Function getArrayObjValueByParamsVal(ByRef arr As Variant, ByVal indexes As Variant) As Variant
    Set getArrayObjValueByParamsVal = getArrayObjValueByIndexArray(arr, indexes)
End Function

'-----------------------------------------------------------------------
'-----------------------------------------------------------------------
'-----------------------------------------------------------------------
' 从多维数组中获取指定索引下的数据
' ！！！最多支持 10 维矩阵 ！！！
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @return 指定索引下的数据
Public Function getArrayValueByIndexArray(ByRef arr As Variant, ByRef indexes As Variant) As Variant
    Dim deminsionCount As Integer
    Dim min As Integer
    min = LBound(indexes)
    deminsionCount = UBound(indexes) - min + 1
    If deminsionCount = 1 Then
        ' 1 维
On Error GoTo catchD1:
        getArrayValueByIndexArray = arr(indexes(min))
        Exit Function
catchD1:
        Set getArrayValueByIndexArray = arr(indexes(min))
    ElseIf deminsionCount = 2 Then
        ' 2 维
On Error GoTo catchD2:
        getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1))
        Exit Function
catchD2:
        Set getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1))
    ElseIf deminsionCount = 3 Then
        ' 3 维
On Error GoTo catchD3:
        getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2))
        Exit Function
catchD3:
        Set getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2))
    ElseIf deminsionCount = 4 Then
        ' 4 维
On Error GoTo catchD4:
        getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3))
        Exit Function
catchD4:
        Set getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3))
    ElseIf deminsionCount = 5 Then
        ' 5 维
On Error GoTo catchD5:
        getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4))
        Exit Function
catchD5:
        Set getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4))
    ElseIf deminsionCount = 6 Then
        ' 6 维
On Error GoTo catchD6:
        getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5))
        Exit Function
catchD6:
        Set getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5))
    ElseIf deminsionCount = 7 Then
        ' 7 维
On Error GoTo catchD7:
        getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6))
        Exit Function
catchD7:
        Set getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6))
    ElseIf deminsionCount = 8 Then
        ' 8 维
On Error GoTo catchD8:
        getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7))
        Exit Function
catchD8:
        Set getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7))
    ElseIf deminsionCount = 9 Then
        ' 9 维
On Error GoTo catchD9:
        getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8))
        Exit Function
catchD9:
        Set getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8))
    ElseIf deminsionCount = 10 Then
        ' 10 维
On Error GoTo catchD10:
        getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8), indexes(min + 9))
        Exit Function
catchD10:
        Set getArrayValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8), indexes(min + 9))
    End If
End Function

' 从多维数组中获取指定索引下的基本类型数据
' ！！！最多支持 10 维矩阵 ！！！
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @return 指定索引下的数据
Public Function getArrayPrimitiveValueByIndexArray(ByRef arr As Variant, ByRef indexes As Variant) As Variant
    Dim deminsionCount As Integer
    Dim min As Integer
    min = LBound(indexes)
    deminsionCount = UBound(indexes) - min + 1
    If deminsionCount = 1 Then
        ' 1 维
        getArrayPrimitiveValueByIndexArray = arr(indexes(min))
    ElseIf deminsionCount = 2 Then
        ' 2 维
        getArrayPrimitiveValueByIndexArray = arr(indexes(min), indexes(min + 1))
    ElseIf deminsionCount = 3 Then
        ' 3 维
        getArrayPrimitiveValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2))
    ElseIf deminsionCount = 4 Then
        ' 4 维
        getArrayPrimitiveValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3))
    ElseIf deminsionCount = 5 Then
        ' 5 维
        getArrayPrimitiveValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4))
    ElseIf deminsionCount = 6 Then
        ' 6 维
        getArrayPrimitiveValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5))
    ElseIf deminsionCount = 7 Then
        ' 7 维
        getArrayPrimitiveValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6))
    ElseIf deminsionCount = 8 Then
        ' 8 维
        getArrayPrimitiveValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7))
    ElseIf deminsionCount = 9 Then
        ' 9 维
        getArrayPrimitiveValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8))
    ElseIf deminsionCount = 10 Then
        ' 10 维
        getArrayPrimitiveValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8), indexes(min + 9))
    End If
End Function

' 从多维数组中获取指定索引下的对象类型数据
' ！！！最多支持 10 维矩阵 ！！！
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @return 指定索引下的数据
Public Function getArrayObjValueByIndexArray(ByRef arr As Variant, ByRef indexes As Variant) As Variant
    Dim deminsionCount As Integer
    Dim min As Integer
    min = LBound(indexes)
    deminsionCount = UBound(indexes) - min + 1
    If deminsionCount = 1 Then
        ' 1 维
On Error GoTo catchD1:
        Set getArrayObjValueByIndexArray = arr(indexes(min))
        Exit Function
catchD1:
        If IsEmpty(arr(indexes(min))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArray = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 2 Then
        ' 2 维
On Error GoTo catchD2:
        Set getArrayObjValueByIndexArray = arr(indexes(min), indexes(min + 1))
        Exit Function
catchD2:
        If IsEmpty(arr(indexes(min), indexes(min + 1))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArray = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 3 Then
        ' 3 维
On Error GoTo catchD3:
        Set getArrayObjValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2))
        Exit Function
catchD3:
        If IsEmpty(arr(indexes(min), indexes(min + 1), indexes(min + 2))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArray = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 4 Then
        ' 4 维
On Error GoTo catchD4:
        Set getArrayObjValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3))
        Exit Function
catchD4:
        If IsEmpty(arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArray = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 5 Then
        ' 5 维
On Error GoTo catchD5:
        Set getArrayObjValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4))
        Exit Function
catchD5:
        If IsEmpty(arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArray = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 6 Then
        ' 6 维
On Error GoTo catchD6:
        Set getArrayObjValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5))
        Exit Function
catchD6:
        If IsEmpty(arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArray = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 7 Then
        ' 7 维
On Error GoTo catchD7:
        Set getArrayObjValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6))
        Exit Function
catchD7:
        If IsEmpty(arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArray = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 8 Then
        ' 8 维
On Error GoTo catchD8:
        Set getArrayObjValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7))
        Exit Function
catchD8:
        If IsEmpty(arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArray = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 9 Then
        ' 9 维
On Error GoTo catchD9:
        Set getArrayObjValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8))
        Exit Function
catchD9:
        If IsEmpty(arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArray = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf deminsionCount = 10 Then
        ' 10 维
On Error GoTo catchD10:
        Set getArrayObjValueByIndexArray = arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8), indexes(min + 9))
        Exit Function
catchD10:
        If IsEmpty(arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8), indexes(min + 9))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArray = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    End If
End Function

'-----------------------------------------------------------------------
'-----------------------------------------------------------------------
'-----------------------------------------------------------------------

' 从多维数组中获取指定索引下的数据
' ！！！最多支持 10 维矩阵 ！！！
'
' 不会委托调用 getArrayValueByIndexArrayForParamsVal 方法来处理，以防止 ParamArray 参数产生的复制行为
'
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @param-array others 额外附加的子级维度的数据索引
' @return 指定索引下的数据
Public Function getArrayValueByIndexArrayForParams(ByRef arr As Variant, _
    ByRef indexes As Variant, ParamArray others() As Variant) As Variant
    ' 1. 计算 others 的数量
    Dim otherSize As Integer
    otherSize = UBound(others) + 1

    ' 2. 如果 others 的数量为 0 ，则直接通过 indexes 来获取
    If otherSize = 0 Then
On Error GoTo catchOtherSizeZero:
        getArrayValueByIndexArrayForParams = getArrayValueByIndexArray(arr, indexes)
        Exit Function
catchOtherSizeZero:
        Set getArrayValueByIndexArrayForParams = getArrayValueByIndexArray(arr, indexes)
        Exit Function
    End If

    ' 3. 计算 indexes 的长度
    Dim mainMin As Integer
    Dim mainMax As Integer
    Dim mainSize As Integer
    mainMin = LBound(indexes)
    mainMax = UBound(indexes)
    mainSize = mainMax - mainMin + 1

    ' 4. 如果 indexes 的数量为 0 ，则直接通过 others 来获取
    If otherSize = 0 Then
On Error GoTo catchIndexesZero:
        getArrayValueByIndexArrayForParams = getArrayValueByParamsVal(arr, others)
        Exit Function
catchIndexesZero:
        Set getArrayValueByIndexArrayForParams = getArrayValueByParamsVal(arr, others)
        Exit Function
    End If

    ' 5. 按照不同的索引数量组合方式来从数组中获取数据
    ' indexes + other 将会产生的组合
    '   索引数量 = indexes的数量 + other的数量
    '    2 = 1 + 1 --> 只有这一种情况，不需要再进行逻辑拆分
    '    3 = 1 + 2, 2 + 1
    '    4 = 1 + 3, 2 + 2, 3 + 1
    '    5 = 1 + 4, 2 + 3, 3 + 2, 4 + 1
    '    6 = 1 + 5, 2 + 4, 3 + 3, 4 + 2, 5 + 1
    '    7 = 1 + 6, 2 + 5, 3 + 4, 4 + 3, 5 + 2, 6 + 1
    '    8 = 1 + 7, 2 + 6, 3 + 5, 4 + 4, 5 + 3, 6 + 2, 7 + 1
    '    9 = 1 + 8, 2 + 7, 3 + 6, 4 + 5, 5 + 4, 6 + 3, 7 + 2, 8 + 1
    '   10 = 1 + 9, 2 + 8, 3 + 7, 4 + 6, 5 + 5, 6 + 4, 7 + 3, 8 + 2, 9 + 1
    '
    ' 对于所有 X = 0 + X 的情况由前面的第 4 步处理
    ' 对于所有 X = X + 0 的情况由前面的第 2 步处理

    Dim size As Integer
    size = mainSize + otherSize

    If size = 2 Then
        ' 2 维
        On Error GoTo catchD2:
        getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0))
        Exit Function
catchD2:
        Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0))
    ElseIf size = 3 Then
        ' 3 维
        If mainSize = 1 And otherSize = 2 Then
            ' 1 + 2
            On Error GoTo catchD3For12:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1))
            Exit Function
catchD3For12:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1))
        Else
            ' 2 + 1
            On Error GoTo catchD3For21:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0))
            Exit Function
catchD3For21:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0))
        End If
    ElseIf size = 4 Then
        ' 4 维
        If mainSize = 1 And otherSize = 3 Then
            ' 1 + 3
            On Error GoTo catchD4For13:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2))
            Exit Function
catchD4For13:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2))
        ElseIf mainSize = 2 And otherSize = 2 Then
            ' 2 + 2
            On Error GoTo catchD4For22:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1))
            Exit Function
catchD4For22:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1))
        Else
            ' 3 + 1
            On Error GoTo catchD4For31:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0))
            Exit Function
catchD4For31:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0))
        End If
    ElseIf size = 5 Then
        ' 5 维
        If mainSize = 1 And otherSize = 4 Then
            ' 1 + 4
            On Error GoTo catchD5For14:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3))
            Exit Function
catchD5For14:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 2 And otherSize = 3 Then
            ' 2 + 3
            On Error GoTo catchD5For23:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2))
            Exit Function
catchD5For23:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2))
        ElseIf mainSize = 3 And otherSize = 2 Then
            ' 3 + 2
            On Error GoTo catchD5For32:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1))
            Exit Function
catchD5For32:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1))
        Else
            ' 4 + 1
            On Error GoTo catchD5For41:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0))
            Exit Function
catchD5For41:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0))
        End If
    ElseIf size = 6 Then
        ' 6 维
        If mainSize = 1 And otherSize = 5 Then
            ' 1 + 5
            On Error GoTo catchD6For15:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD6For15:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 2 And otherSize = 4 Then
            ' 2 + 4
            On Error GoTo catchD6For24:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3))
            Exit Function
catchD6For24:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 3 And otherSize = 3 Then
            ' 3 + 3
            On Error GoTo catchD6For33:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2))
            Exit Function
catchD6For33:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2))
        ElseIf mainSize = 4 And otherSize = 2 Then
            ' 4 + 2
            On Error GoTo catchD6For42:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1))
            Exit Function
catchD6For42:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1))
        Else
            ' 5 + 1
            On Error GoTo catchD6For51:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0))
            Exit Function
catchD6For51:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0))
        End If
    ElseIf size = 7 Then
        ' 7 维
        If mainSize = 1 And otherSize = 6 Then
            ' 1 + 6
            On Error GoTo catchD7For16:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD7For16:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 2 And otherSize = 5 Then
            ' 2 + 5
            On Error GoTo catchD7For25:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD7For25:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 3 And otherSize = 4 Then
            ' 3 + 4
            On Error GoTo catchD7For34:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3))
            Exit Function
catchD7For34:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 4 And otherSize = 3 Then
            ' 4 + 3
            On Error GoTo catchD7For43:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2))
            Exit Function
catchD7For43:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2))
        ElseIf mainSize = 5 And otherSize = 2 Then
            ' 5 + 2
            On Error GoTo catchD7For52:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1))
            Exit Function
catchD7For52:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1))
        Else
            ' 6 + 1
            On Error GoTo catchD7For61:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0))
            Exit Function
catchD7For61:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0))
        End If
    ElseIf size = 8 Then
        ' 8 维
        If mainSize = 1 And otherSize = 7 Then
            ' 1 + 7
            On Error GoTo catchD8For17:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD8For17:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 2 And otherSize = 6 Then
            ' 2 + 6
            On Error GoTo catchD8For26:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD8For26:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 3 And otherSize = 5 Then
            ' 3 + 5
            On Error GoTo catchD8For35:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD8For35:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 4 And otherSize = 4 Then
            ' 4 + 4
            On Error GoTo catchD8For44:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3))
            Exit Function
catchD8For44:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 5 And otherSize = 3 Then
            ' 5 + 3
            On Error GoTo catchD8For53:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2))
            Exit Function
catchD8For53:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2))
        ElseIf mainSize = 6 And otherSize = 2 Then
            ' 6 + 2
            On Error GoTo catchD8For62:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1))
            Exit Function
catchD8For62:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1))
        Else
            ' 7 + 1
            On Error GoTo catchD8For71:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0))
            Exit Function
catchD8For71:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0))
        End If
    ElseIf size = 9 Then
        ' 9 维
        If mainSize = 1 And otherSize = 8 Then
            ' 1 + 8
            On Error GoTo catchD9For18:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
            Exit Function
catchD9For18:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
        ElseIf mainSize = 2 And otherSize = 7 Then
            ' 2 + 7
            On Error GoTo catchD9For27:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD9For27:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 3 And otherSize = 6 Then
            ' 3 + 6
            On Error GoTo catchD9For36:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD9For36:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 4 And otherSize = 5 Then
            ' 4 + 5
            On Error GoTo catchD9For45:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD9For45:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 5 And otherSize = 4 Then
            ' 5 + 4
            On Error GoTo catchD9For54:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3))
            Exit Function
catchD9For54:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 6 And otherSize = 3 Then
            ' 6 + 3
            On Error GoTo catchD9For63:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2))
            Exit Function
catchD9For63:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2))
        ElseIf mainSize = 7 And otherSize = 2 Then
            ' 7 + 2
            On Error GoTo catchD9For72:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1))
            Exit Function
catchD9For72:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1))
        Else
            ' 8 + 1
            On Error GoTo catchD9For81:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0))
            Exit Function
catchD9For81:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0))
        End If
    ElseIf size = 10 Then
        ' 10 维
        If mainSize = 1 And otherSize = 9 Then
            ' 1 + 9
            On Error GoTo catchD10For19:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8))
            Exit Function
catchD10For19:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8))
        ElseIf mainSize = 2 And otherSize = 8 Then
            ' 2 + 8
            On Error GoTo catchD10For28:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
            Exit Function
catchD10For28:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
        ElseIf mainSize = 3 And otherSize = 7 Then
            ' 3 + 7
            On Error GoTo catchD10For37:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD10For37:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 4 And otherSize = 6 Then
            ' 4 + 6
            On Error GoTo catchD10For46:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD10For46:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 5 And otherSize = 5 Then
            ' 5 + 5
            On Error GoTo catchD10For55:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD10For55:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 6 And otherSize = 4 Then
            ' 6 + 4
            On Error GoTo catchD10For64:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3))
            Exit Function
catchD10For64:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 7 And otherSize = 3 Then
            ' 7 + 3
            On Error GoTo catchD10For73:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2))
            Exit Function
catchD10For73:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2))
        ElseIf mainSize = 8 And otherSize = 2 Then
            ' 8 + 2
            On Error GoTo catchD10For82:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1))
            Exit Function
catchD10For82:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1))
        Else
            ' 9 + 1
            On Error GoTo catchD10For91:
            getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0))
            Exit Function
catchD10For91:
            Set getArrayValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0))
        End If
    End If
End Function

' 从多维数组中获取指定索引下的基础类型数据
' ！！！最多支持 10 维矩阵 ！！！
'
' 不会委托调用 getArrayPrimitiveValueByIndexArrayForParamsVal 方法来处理，以防止 ParamArray 参数产生的复制行为
'
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @param-array others 额外附加的子级维度的数据索引
' @return 指定索引下的数据
Public Function getArrayPrimitiveValueByIndexArrayForParams(ByRef arr As Variant, _
    ByRef indexes As Variant, ParamArray others() As Variant) As Variant
    ' 1. 计算 others 的数量
    Dim otherSize As Integer
    otherSize = UBound(others) + 1

    ' 2. 如果 others 的数量为 0 ，则直接通过 indexes 来获取
    If otherSize = 0 Then
        getArrayPrimitiveValueByIndexArrayForParams = getArrayPrimitiveValueByIndexArray(arr, indexes)
        Exit Function
    End If

    ' 3. 计算 indexes 的长度
    Dim mainMin As Integer
    Dim mainMax As Integer
    Dim mainSize As Integer
    mainMin = LBound(indexes)
    mainMax = UBound(indexes)
    mainSize = mainMax - mainMin + 1

    ' 4. 如果 indexes 的数量为 0 ，则直接通过 others 来获取
    If otherSize = 0 Then
        getArrayPrimitiveValueByIndexArrayForParams = getArrayPrimitiveValueByParamsVal(arr, others)
        Exit Function
    End If

    ' 5. 按照不同的索引数量组合方式来从数组中获取数据
    ' indexes + other 将会产生的组合
    '   索引数量 = indexes的数量 + other的数量
    '    2 = 1 + 1 --> 只有这一种情况，不需要再进行逻辑拆分
    '    3 = 1 + 2, 2 + 1
    '    4 = 1 + 3, 2 + 2, 3 + 1
    '    5 = 1 + 4, 2 + 3, 3 + 2, 4 + 1
    '    6 = 1 + 5, 2 + 4, 3 + 3, 4 + 2, 5 + 1
    '    7 = 1 + 6, 2 + 5, 3 + 4, 4 + 3, 5 + 2, 6 + 1
    '    8 = 1 + 7, 2 + 6, 3 + 5, 4 + 4, 5 + 3, 6 + 2, 7 + 1
    '    9 = 1 + 8, 2 + 7, 3 + 6, 4 + 5, 5 + 4, 6 + 3, 7 + 2, 8 + 1
    '   10 = 1 + 9, 2 + 8, 3 + 7, 4 + 6, 5 + 5, 6 + 4, 7 + 3, 8 + 2, 9 + 1
    '
    ' 对于所有 X = 0 + X 的情况由前面的第 4 步处理
    ' 对于所有 X = X + 0 的情况由前面的第 2 步处理

    Dim size As Integer
    size = mainSize + otherSize

    If size = 2 Then
        ' 2 维
        getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), others(0))
    ElseIf size = 3 Then
        ' 3 维
        If mainSize = 1 And otherSize = 2 Then
            ' 1 + 2
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1))
        Else
            ' 2 + 1
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0))
        End If
    ElseIf size = 4 Then
        ' 4 维
        If mainSize = 1 And otherSize = 3 Then
            ' 1 + 3
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2))
        ElseIf mainSize = 2 And otherSize = 2 Then
            ' 2 + 2
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1))
        Else
            ' 3 + 1
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0))
        End If
    ElseIf size = 5 Then
        ' 5 维
        If mainSize = 1 And otherSize = 4 Then
            ' 1 + 4
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 2 And otherSize = 3 Then
            ' 2 + 3
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2))
        ElseIf mainSize = 3 And otherSize = 2 Then
            ' 3 + 2
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1))
        Else
            ' 4 + 1
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0))
        End If
    ElseIf size = 6 Then
        ' 6 维
        If mainSize = 1 And otherSize = 5 Then
            ' 1 + 5
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 2 And otherSize = 4 Then
            ' 2 + 4
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 3 And otherSize = 3 Then
            ' 3 + 3
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2))
        ElseIf mainSize = 4 And otherSize = 2 Then
            ' 4 + 2
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1))
        Else
            ' 5 + 1
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0))
        End If
    ElseIf size = 7 Then
        ' 7 维
        If mainSize = 1 And otherSize = 6 Then
            ' 1 + 6
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 2 And otherSize = 5 Then
            ' 2 + 5
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 3 And otherSize = 4 Then
            ' 3 + 4
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 4 And otherSize = 3 Then
            ' 4 + 3
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2))
        ElseIf mainSize = 5 And otherSize = 2 Then
            ' 5 + 2
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1))
        Else
            ' 6 + 1
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0))
        End If
    ElseIf size = 8 Then
        ' 8 维
        If mainSize = 1 And otherSize = 7 Then
            ' 1 + 7
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 2 And otherSize = 6 Then
            ' 2 + 6
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 3 And otherSize = 5 Then
            ' 3 + 5
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 4 And otherSize = 4 Then
            ' 4 + 4
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 5 And otherSize = 3 Then
            ' 5 + 3
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2))
        ElseIf mainSize = 6 And otherSize = 2 Then
            ' 6 + 2
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1))
        Else
            ' 7 + 1
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0))
        End If
    ElseIf size = 9 Then
        ' 9 维
        If mainSize = 1 And otherSize = 8 Then
            ' 1 + 8
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
        ElseIf mainSize = 2 And otherSize = 7 Then
            ' 2 + 7
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 3 And otherSize = 6 Then
            ' 3 + 6
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 4 And otherSize = 5 Then
            ' 4 + 5
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 5 And otherSize = 4 Then
            ' 5 + 4
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 6 And otherSize = 3 Then
            ' 6 + 3
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2))
        ElseIf mainSize = 7 And otherSize = 2 Then
            ' 7 + 2
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1))
        Else
            ' 8 + 1
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0))
        End If
    ElseIf size = 10 Then
        ' 10 维
        If mainSize = 1 And otherSize = 9 Then
            ' 1 + 9
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8))
        ElseIf mainSize = 2 And otherSize = 8 Then
            ' 2 + 8
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
        ElseIf mainSize = 3 And otherSize = 7 Then
            ' 3 + 7
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 4 And otherSize = 6 Then
            ' 4 + 6
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 5 And otherSize = 5 Then
            ' 5 + 5
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 6 And otherSize = 4 Then
            ' 6 + 4
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 7 And otherSize = 3 Then
            ' 7 + 3
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2))
        ElseIf mainSize = 8 And otherSize = 2 Then
            ' 8 + 2
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1))
        Else
            ' 9 + 1
            getArrayPrimitiveValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0))
        End If
    End If
End Function

' 从多维数组中获取指定索引下的对象类型数据
' ！！！最多支持 10 维矩阵 ！！！
'
' 不会委托调用 getArrayObjValueByIndexArrayForParamsVal 方法来处理，以防止 ParamArray 参数产生的复制行为
'
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @param-array others 额外附加的子级维度的数据索引
' @return 指定索引下的数据
Public Function getArrayObjValueByIndexArrayForParams(ByRef arr As Variant, _
    ByRef indexes As Variant, ParamArray others() As Variant) As Variant
    ' 1. 计算 others 的数量
    Dim otherSize As Integer
    otherSize = UBound(others) + 1

    ' 2. 如果 others 的数量为 0 ，则直接通过 indexes 来获取
    If otherSize = 0 Then
        Set getArrayObjValueByIndexArrayForParams = getArrayObjValueByIndexArray(arr, indexes)
        Exit Function
    End If

    ' 3. 计算 indexes 的长度
    Dim mainMin As Integer
    Dim mainMax As Integer
    Dim mainSize As Integer
    mainMin = LBound(indexes)
    mainMax = UBound(indexes)
    mainSize = mainMax - mainMin + 1

    ' 4. 如果 indexes 的数量为 0 ，则直接通过 others 来获取
    If otherSize = 0 Then
        Set getArrayObjValueByIndexArrayForParams = getArrayObjValueByParamsVal(arr, others)
        Exit Function
    End If

    ' 5. 按照不同的索引数量组合方式来从数组中获取数据
    ' indexes + other 将会产生的组合
    '   索引数量 = indexes的数量 + other的数量
    '    2 = 1 + 1 --> 只有这一种情况，不需要再进行逻辑拆分
    '    3 = 1 + 2, 2 + 1
    '    4 = 1 + 3, 2 + 2, 3 + 1
    '    5 = 1 + 4, 2 + 3, 3 + 2, 4 + 1
    '    6 = 1 + 5, 2 + 4, 3 + 3, 4 + 2, 5 + 1
    '    7 = 1 + 6, 2 + 5, 3 + 4, 4 + 3, 5 + 2, 6 + 1
    '    8 = 1 + 7, 2 + 6, 3 + 5, 4 + 4, 5 + 3, 6 + 2, 7 + 1
    '    9 = 1 + 8, 2 + 7, 3 + 6, 4 + 5, 5 + 4, 6 + 3, 7 + 2, 8 + 1
    '   10 = 1 + 9, 2 + 8, 3 + 7, 4 + 6, 5 + 5, 6 + 4, 7 + 3, 8 + 2, 9 + 1
    '
    ' 对于所有 X = 0 + X 的情况由前面的第 4 步处理
    ' 对于所有 X = X + 0 的情况由前面的第 2 步处理

    Dim size As Integer
    size = mainSize + otherSize

    If size = 2 Then
        ' 2 维
        On Error GoTo catchD2:
        Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), others(0))
        Exit Function
catchD2:
        If IsEmpty(arr(indexes(mainMin), others(0))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArrayForParams = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf size = 3 Then
        ' 3 维
        If mainSize = 1 And otherSize = 2 Then
            ' 1 + 2
            On Error GoTo catchD3For12:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1))
            Exit Function
catchD3For12:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 2 + 1
            On Error GoTo catchD3For21:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0))
            Exit Function
catchD3For21:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 4 Then
        ' 4 维
        If mainSize = 1 And otherSize = 3 Then
            ' 1 + 3
            On Error GoTo catchD4For13:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2))
            Exit Function
catchD4For13:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 2 Then
            ' 2 + 2
            On Error GoTo catchD4For22:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1))
            Exit Function
catchD4For22:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 3 + 1
            On Error GoTo catchD4For31:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0))
            Exit Function
catchD4For31:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 5 Then
        ' 5 维
        If mainSize = 1 And otherSize = 4 Then
            ' 1 + 4
            On Error GoTo catchD5For14:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3))
            Exit Function
catchD5For14:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 3 Then
            ' 2 + 3
            On Error GoTo catchD5For23:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2))
            Exit Function
catchD5For23:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 2 Then
            ' 3 + 2
            On Error GoTo catchD5For32:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1))
            Exit Function
catchD5For32:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 4 + 1
            On Error GoTo catchD5For41:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0))
            Exit Function
catchD5For41:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 6 Then
        ' 6 维
        If mainSize = 1 And otherSize = 5 Then
            ' 1 + 5
            On Error GoTo catchD6For15:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD6For15:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 4 Then
            ' 2 + 4
            On Error GoTo catchD6For24:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3))
            Exit Function
catchD6For24:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 3 Then
            ' 3 + 3
            On Error GoTo catchD6For33:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2))
            Exit Function
catchD6For33:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 4 And otherSize = 2 Then
            ' 4 + 2
            On Error GoTo catchD6For42:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1))
            Exit Function
catchD6For42:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 5 + 1
            On Error GoTo catchD6For51:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0))
            Exit Function
catchD6For51:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 7 Then
        ' 7 维
        If mainSize = 1 And otherSize = 6 Then
            ' 1 + 6
            On Error GoTo catchD7For16:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD7For16:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 5 Then
            ' 2 + 5
            On Error GoTo catchD7For25:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD7For25:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 4 Then
            ' 3 + 4
            On Error GoTo catchD7For34:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3))
            Exit Function
catchD7For34:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 4 And otherSize = 3 Then
            ' 4 + 3
            On Error GoTo catchD7For43:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2))
            Exit Function
catchD7For43:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 5 And otherSize = 2 Then
            ' 5 + 2
            On Error GoTo catchD7For52:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1))
            Exit Function
catchD7For52:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 6 + 1
            On Error GoTo catchD7For61:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0))
            Exit Function
catchD7For61:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 8 Then
        ' 8 维
        If mainSize = 1 And otherSize = 7 Then
            ' 1 + 7
            On Error GoTo catchD8For17:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD8For17:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 6 Then
            ' 2 + 6
            On Error GoTo catchD8For26:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD8For26:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 5 Then
            ' 3 + 5
            On Error GoTo catchD8For35:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD8For35:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 4 And otherSize = 4 Then
            ' 4 + 4
            On Error GoTo catchD8For44:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3))
            Exit Function
catchD8For44:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 5 And otherSize = 3 Then
            ' 5 + 3
            On Error GoTo catchD8For53:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2))
            Exit Function
catchD8For53:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 6 And otherSize = 2 Then
            ' 6 + 2
            On Error GoTo catchD8For62:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1))
            Exit Function
catchD8For62:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 7 + 1
            On Error GoTo catchD8For71:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0))
            Exit Function
catchD8For71:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 9 Then
        ' 9 维
        If mainSize = 1 And otherSize = 8 Then
            ' 1 + 8
            On Error GoTo catchD9For18:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
            Exit Function
catchD9For18:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 7 Then
            ' 2 + 7
            On Error GoTo catchD9For27:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD9For27:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 6 Then
            ' 3 + 6
            On Error GoTo catchD9For36:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD9For36:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 4 And otherSize = 5 Then
            ' 4 + 5
            On Error GoTo catchD9For45:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD9For45:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 5 And otherSize = 4 Then
            ' 5 + 4
            On Error GoTo catchD9For54:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3))
            Exit Function
catchD9For54:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 6 And otherSize = 3 Then
            ' 6 + 3
            On Error GoTo catchD9For63:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2))
            Exit Function
catchD9For63:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 7 And otherSize = 2 Then
            ' 7 + 2
            On Error GoTo catchD9For72:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1))
            Exit Function
catchD9For72:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 8 + 1
            On Error GoTo catchD9For81:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0))
            Exit Function
catchD9For81:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 10 Then
        ' 10 维
        If mainSize = 1 And otherSize = 9 Then
            ' 1 + 9
            On Error GoTo catchD10For19:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8))
            Exit Function
catchD10For19:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 8 Then
            ' 2 + 8
            On Error GoTo catchD10For28:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
            Exit Function
catchD10For28:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 7 Then
            ' 3 + 7
            On Error GoTo catchD10For37:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD10For37:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 4 And otherSize = 6 Then
            ' 4 + 6
            On Error GoTo catchD10For46:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD10For46:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 5 And otherSize = 5 Then
            ' 5 + 5
            On Error GoTo catchD10For55:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD10For55:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 6 And otherSize = 4 Then
            ' 6 + 4
            On Error GoTo catchD10For64:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3))
            Exit Function
catchD10For64:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 7 And otherSize = 3 Then
            ' 7 + 3
            On Error GoTo catchD10For73:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2))
            Exit Function
catchD10For73:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 8 And otherSize = 2 Then
            ' 8 + 2
            On Error GoTo catchD10For82:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1))
            Exit Function
catchD10For82:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 9 + 1
            On Error GoTo catchD10For91:
            Set getArrayObjValueByIndexArrayForParams = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0))
            Exit Function
catchD10For91:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParams = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    End If
End Function

'-----------------------------------------------------------------------
'-----------------------------------------------------------------------
'-----------------------------------------------------------------------

' 从多维数组中获取指定索引下的数据
' ！！！最多支持 10 维矩阵 ！！！
' 当前方法专门用来处理前一个方法接受了 paramArray 参数并需要获取数据的情况, 如:
'    f(arr, indexes, 3,4)
'
'    Sub f(ByRef arr As Variant, ByRef indexes As Variant, ParamArray ps() As Variant)
'        ' 调用该方法，以使得 ps 可以作为参数进行传递
'        Dim result As String
'        newArray = UtilsArray.getArrayValueByIndexArrayForParamsVal(arr, indexes, ps)
'    End Sub
'
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @param others 额外附加的子级维度的数据索引（用来接收前一个方法的 paramArray 参数）
' @return 指定索引下的数据
Public Function getArrayValueByIndexArrayForParamsVal(ByRef arr As Variant, _
    ByRef indexes As Variant, ByVal others As Variant) As Variant
    ' 1. 计算 others 的数量
    Dim otherSize As Integer
    otherSize = UBound(others) + 1

    ' 2. 如果 others 的数量为 0 ，则直接通过 indexes 来获取
    If otherSize = 0 Then
On Error GoTo catchOtherSizeZero:
        getArrayValueByIndexArrayForParamsVal = getArrayValueByIndexArray(arr, indexes)
        Exit Function
catchOtherSizeZero:
        Set getArrayValueByIndexArrayForParamsVal = getArrayValueByIndexArray(arr, indexes)
        Exit Function
    End If

    ' 3. 计算 indexes 的长度
    Dim mainMin As Integer
    Dim mainMax As Integer
    Dim mainSize As Integer
    mainMin = LBound(indexes)
    mainMax = UBound(indexes)
    mainSize = mainMax - mainMin + 1

    ' 4. 如果 indexes 的数量为 0 ，则直接通过 others 来获取
    If otherSize = 0 Then
On Error GoTo catchIndexesZero:
        getArrayValueByIndexArrayForParamsVal = getArrayValueByParamsVal(arr, others)
        Exit Function
catchIndexesZero:
        Set getArrayValueByIndexArrayForParamsVal = getArrayValueByParamsVal(arr, others)
        Exit Function
    End If

    ' 5. 按照不同的索引数量组合方式来从数组中获取数据
    ' indexes + other 将会产生的组合
    '   索引数量 = indexes的数量 + other的数量
    '    2 = 1 + 1 --> 只有这一种情况，不需要再进行逻辑拆分
    '    3 = 1 + 2, 2 + 1
    '    4 = 1 + 3, 2 + 2, 3 + 1
    '    5 = 1 + 4, 2 + 3, 3 + 2, 4 + 1
    '    6 = 1 + 5, 2 + 4, 3 + 3, 4 + 2, 5 + 1
    '    7 = 1 + 6, 2 + 5, 3 + 4, 4 + 3, 5 + 2, 6 + 1
    '    8 = 1 + 7, 2 + 6, 3 + 5, 4 + 4, 5 + 3, 6 + 2, 7 + 1
    '    9 = 1 + 8, 2 + 7, 3 + 6, 4 + 5, 5 + 4, 6 + 3, 7 + 2, 8 + 1
    '   10 = 1 + 9, 2 + 8, 3 + 7, 4 + 6, 5 + 5, 6 + 4, 7 + 3, 8 + 2, 9 + 1
    '
    ' 对于所有 X = 0 + X 的情况由前面的第 4 步处理
    ' 对于所有 X = X + 0 的情况由前面的第 2 步处理

    Dim size As Integer
    size = mainSize + otherSize

    If size = 2 Then
        ' 2 维
        On Error GoTo catchD2:
        getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0))
        Exit Function
catchD2:
        Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0))
    ElseIf size = 3 Then
        ' 3 维
        If mainSize = 1 And otherSize = 2 Then
            ' 1 + 2
            On Error GoTo catchD3For12:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1))
            Exit Function
catchD3For12:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1))
        Else
            ' 2 + 1
            On Error GoTo catchD3For21:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0))
            Exit Function
catchD3For21:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0))
        End If
    ElseIf size = 4 Then
        ' 4 维
        If mainSize = 1 And otherSize = 3 Then
            ' 1 + 3
            On Error GoTo catchD4For13:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2))
            Exit Function
catchD4For13:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2))
        ElseIf mainSize = 2 And otherSize = 2 Then
            ' 2 + 2
            On Error GoTo catchD4For22:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1))
            Exit Function
catchD4For22:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1))
        Else
            ' 3 + 1
            On Error GoTo catchD4For31:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0))
            Exit Function
catchD4For31:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0))
        End If
    ElseIf size = 5 Then
        ' 5 维
        If mainSize = 1 And otherSize = 4 Then
            ' 1 + 4
            On Error GoTo catchD5For14:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3))
            Exit Function
catchD5For14:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 2 And otherSize = 3 Then
            ' 2 + 3
            On Error GoTo catchD5For23:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2))
            Exit Function
catchD5For23:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2))
        ElseIf mainSize = 3 And otherSize = 2 Then
            ' 3 + 2
            On Error GoTo catchD5For32:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1))
            Exit Function
catchD5For32:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1))
        Else
            ' 4 + 1
            On Error GoTo catchD5For41:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0))
            Exit Function
catchD5For41:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0))
        End If
    ElseIf size = 6 Then
        ' 6 维
        If mainSize = 1 And otherSize = 5 Then
            ' 1 + 5
            On Error GoTo catchD6For15:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD6For15:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 2 And otherSize = 4 Then
            ' 2 + 4
            On Error GoTo catchD6For24:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3))
            Exit Function
catchD6For24:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 3 And otherSize = 3 Then
            ' 3 + 3
            On Error GoTo catchD6For33:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2))
            Exit Function
catchD6For33:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2))
        ElseIf mainSize = 4 And otherSize = 2 Then
            ' 4 + 2
            On Error GoTo catchD6For42:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1))
            Exit Function
catchD6For42:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1))
        Else
            ' 5 + 1
            On Error GoTo catchD6For51:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0))
            Exit Function
catchD6For51:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0))
        End If
    ElseIf size = 7 Then
        ' 7 维
        If mainSize = 1 And otherSize = 6 Then
            ' 1 + 6
            On Error GoTo catchD7For16:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD7For16:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 2 And otherSize = 5 Then
            ' 2 + 5
            On Error GoTo catchD7For25:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD7For25:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 3 And otherSize = 4 Then
            ' 3 + 4
            On Error GoTo catchD7For34:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3))
            Exit Function
catchD7For34:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 4 And otherSize = 3 Then
            ' 4 + 3
            On Error GoTo catchD7For43:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2))
            Exit Function
catchD7For43:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2))
        ElseIf mainSize = 5 And otherSize = 2 Then
            ' 5 + 2
            On Error GoTo catchD7For52:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1))
            Exit Function
catchD7For52:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1))
        Else
            ' 6 + 1
            On Error GoTo catchD7For61:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0))
            Exit Function
catchD7For61:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0))
        End If
    ElseIf size = 8 Then
        ' 8 维
        If mainSize = 1 And otherSize = 7 Then
            ' 1 + 7
            On Error GoTo catchD8For17:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD8For17:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 2 And otherSize = 6 Then
            ' 2 + 6
            On Error GoTo catchD8For26:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD8For26:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 3 And otherSize = 5 Then
            ' 3 + 5
            On Error GoTo catchD8For35:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD8For35:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 4 And otherSize = 4 Then
            ' 4 + 4
            On Error GoTo catchD8For44:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3))
            Exit Function
catchD8For44:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 5 And otherSize = 3 Then
            ' 5 + 3
            On Error GoTo catchD8For53:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2))
            Exit Function
catchD8For53:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2))
        ElseIf mainSize = 6 And otherSize = 2 Then
            ' 6 + 2
            On Error GoTo catchD8For62:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1))
            Exit Function
catchD8For62:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1))
        Else
            ' 7 + 1
            On Error GoTo catchD8For71:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0))
            Exit Function
catchD8For71:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0))
        End If
    ElseIf size = 9 Then
        ' 9 维
        If mainSize = 1 And otherSize = 8 Then
            ' 1 + 8
            On Error GoTo catchD9For18:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
            Exit Function
catchD9For18:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
        ElseIf mainSize = 2 And otherSize = 7 Then
            ' 2 + 7
            On Error GoTo catchD9For27:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD9For27:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 3 And otherSize = 6 Then
            ' 3 + 6
            On Error GoTo catchD9For36:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD9For36:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 4 And otherSize = 5 Then
            ' 4 + 5
            On Error GoTo catchD9For45:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD9For45:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 5 And otherSize = 4 Then
            ' 5 + 4
            On Error GoTo catchD9For54:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3))
            Exit Function
catchD9For54:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 6 And otherSize = 3 Then
            ' 6 + 3
            On Error GoTo catchD9For63:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2))
            Exit Function
catchD9For63:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2))
        ElseIf mainSize = 7 And otherSize = 2 Then
            ' 7 + 2
            On Error GoTo catchD9For72:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1))
            Exit Function
catchD9For72:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1))
        Else
            ' 8 + 1
            On Error GoTo catchD9For81:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0))
            Exit Function
catchD9For81:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0))
        End If
    ElseIf size = 10 Then
        ' 10 维
        If mainSize = 1 And otherSize = 9 Then
            ' 1 + 9
            On Error GoTo catchD10For19:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8))
            Exit Function
catchD10For19:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8))
        ElseIf mainSize = 2 And otherSize = 8 Then
            ' 2 + 8
            On Error GoTo catchD10For28:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
            Exit Function
catchD10For28:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
        ElseIf mainSize = 3 And otherSize = 7 Then
            ' 3 + 7
            On Error GoTo catchD10For37:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD10For37:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 4 And otherSize = 6 Then
            ' 4 + 6
            On Error GoTo catchD10For46:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD10For46:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 5 And otherSize = 5 Then
            ' 5 + 5
            On Error GoTo catchD10For55:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD10For55:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 6 And otherSize = 4 Then
            ' 6 + 4
            On Error GoTo catchD10For64:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3))
            Exit Function
catchD10For64:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 7 And otherSize = 3 Then
            ' 7 + 3
            On Error GoTo catchD10For73:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2))
            Exit Function
catchD10For73:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2))
        ElseIf mainSize = 8 And otherSize = 2 Then
            ' 8 + 2
            On Error GoTo catchD10For82:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1))
            Exit Function
catchD10For82:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1))
        Else
            ' 9 + 1
            On Error GoTo catchD10For91:
            getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0))
            Exit Function
catchD10For91:
            Set getArrayValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0))
        End If
    End If
End Function


' 从多维数组中获取指定索引下的基础类型数据
' ！！！最多支持 10 维矩阵 ！！！
' 当前方法专门用来处理前一个方法接受了 paramArray 参数并需要获取数据的情况, 如:
'    f(arr, indexes, 3,4)
'
'    Sub f(ByRef arr As Variant, ByRef indexes As Variant, ParamArray ps() As Variant)
'        ' 调用该方法，以使得 ps 可以作为参数进行传递
'        Dim result As String
'        newArray = UtilsArray.getArrayPrimitiveValueByIndexArrayForParamsVal(arr, indexes, ps)
'    End Sub
'
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @param others 额外附加的子级维度的数据索引（用来接收前一个方法的 paramArray 参数）
' @return 指定索引下的数据
Public Function getArrayPrimitiveValueByIndexArrayForParamsVal(ByRef arr As Variant, _
    ByRef indexes As Variant, ByVal others As Variant) As Variant
    ' 1. 计算 others 的数量
    Dim otherSize As Integer
    otherSize = UBound(others) + 1

    ' 2. 如果 others 的数量为 0 ，则直接通过 indexes 来获取
    If otherSize = 0 Then
        getArrayPrimitiveValueByIndexArrayForParamsVal = getArrayPrimitiveValueByIndexArray(arr, indexes)
        Exit Function
    End If

    ' 3. 计算 indexes 的长度
    Dim mainMin As Integer
    Dim mainMax As Integer
    Dim mainSize As Integer
    mainMin = LBound(indexes)
    mainMax = UBound(indexes)
    mainSize = mainMax - mainMin + 1

    ' 4. 如果 indexes 的数量为 0 ，则直接通过 others 来获取
    If otherSize = 0 Then
        getArrayPrimitiveValueByIndexArrayForParamsVal = getArrayPrimitiveValueByParamsVal(arr, others)
        Exit Function
    End If

    ' 5. 按照不同的索引数量组合方式来从数组中获取数据
    ' indexes + other 将会产生的组合
    '   索引数量 = indexes的数量 + other的数量
    '    2 = 1 + 1 --> 只有这一种情况，不需要再进行逻辑拆分
    '    3 = 1 + 2, 2 + 1
    '    4 = 1 + 3, 2 + 2, 3 + 1
    '    5 = 1 + 4, 2 + 3, 3 + 2, 4 + 1
    '    6 = 1 + 5, 2 + 4, 3 + 3, 4 + 2, 5 + 1
    '    7 = 1 + 6, 2 + 5, 3 + 4, 4 + 3, 5 + 2, 6 + 1
    '    8 = 1 + 7, 2 + 6, 3 + 5, 4 + 4, 5 + 3, 6 + 2, 7 + 1
    '    9 = 1 + 8, 2 + 7, 3 + 6, 4 + 5, 5 + 4, 6 + 3, 7 + 2, 8 + 1
    '   10 = 1 + 9, 2 + 8, 3 + 7, 4 + 6, 5 + 5, 6 + 4, 7 + 3, 8 + 2, 9 + 1
    '
    ' 对于所有 X = 0 + X 的情况由前面的第 4 步处理
    ' 对于所有 X = X + 0 的情况由前面的第 2 步处理

    Dim size As Integer
    size = mainSize + otherSize

    If size = 2 Then
        ' 2 维
        getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0))
    ElseIf size = 3 Then
        ' 3 维
        If mainSize = 1 And otherSize = 2 Then
            ' 1 + 2
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1))
        Else
            ' 2 + 1
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0))
        End If
    ElseIf size = 4 Then
        ' 4 维
        If mainSize = 1 And otherSize = 3 Then
            ' 1 + 3
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2))
        ElseIf mainSize = 2 And otherSize = 2 Then
            ' 2 + 2
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1))
        Else
            ' 3 + 1
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0))
        End If
    ElseIf size = 5 Then
        ' 5 维
        If mainSize = 1 And otherSize = 4 Then
            ' 1 + 4
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 2 And otherSize = 3 Then
            ' 2 + 3
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2))
        ElseIf mainSize = 3 And otherSize = 2 Then
            ' 3 + 2
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1))
        Else
            ' 4 + 1
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0))
        End If
    ElseIf size = 6 Then
        ' 6 维
        If mainSize = 1 And otherSize = 5 Then
            ' 1 + 5
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 2 And otherSize = 4 Then
            ' 2 + 4
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 3 And otherSize = 3 Then
            ' 3 + 3
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2))
        ElseIf mainSize = 4 And otherSize = 2 Then
            ' 4 + 2
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1))
        Else
            ' 5 + 1
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0))
        End If
    ElseIf size = 7 Then
        ' 7 维
        If mainSize = 1 And otherSize = 6 Then
            ' 1 + 6
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 2 And otherSize = 5 Then
            ' 2 + 5
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 3 And otherSize = 4 Then
            ' 3 + 4
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 4 And otherSize = 3 Then
            ' 4 + 3
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2))
        ElseIf mainSize = 5 And otherSize = 2 Then
            ' 5 + 2
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1))
        Else
            ' 6 + 1
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0))
        End If
    ElseIf size = 8 Then
        ' 8 维
        If mainSize = 1 And otherSize = 7 Then
            ' 1 + 7
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 2 And otherSize = 6 Then
            ' 2 + 6
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 3 And otherSize = 5 Then
            ' 3 + 5
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 4 And otherSize = 4 Then
            ' 4 + 4
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 5 And otherSize = 3 Then
            ' 5 + 3
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2))
        ElseIf mainSize = 6 And otherSize = 2 Then
            ' 6 + 2
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1))
        Else
            ' 7 + 1
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0))
        End If
    ElseIf size = 9 Then
        ' 9 维
        If mainSize = 1 And otherSize = 8 Then
            ' 1 + 8
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
        ElseIf mainSize = 2 And otherSize = 7 Then
            ' 2 + 7
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 3 And otherSize = 6 Then
            ' 3 + 6
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 4 And otherSize = 5 Then
            ' 4 + 5
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 5 And otherSize = 4 Then
            ' 5 + 4
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 6 And otherSize = 3 Then
            ' 6 + 3
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2))
        ElseIf mainSize = 7 And otherSize = 2 Then
            ' 7 + 2
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1))
        Else
            ' 8 + 1
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0))
        End If
    ElseIf size = 10 Then
        ' 10 维
        If mainSize = 1 And otherSize = 9 Then
            ' 1 + 9
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8))
        ElseIf mainSize = 2 And otherSize = 8 Then
            ' 2 + 8
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
        ElseIf mainSize = 3 And otherSize = 7 Then
            ' 3 + 7
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
        ElseIf mainSize = 4 And otherSize = 6 Then
            ' 4 + 6
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5))
        ElseIf mainSize = 5 And otherSize = 5 Then
            ' 5 + 5
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4))
        ElseIf mainSize = 6 And otherSize = 4 Then
            ' 6 + 4
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3))
        ElseIf mainSize = 7 And otherSize = 3 Then
            ' 7 + 3
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2))
        ElseIf mainSize = 8 And otherSize = 2 Then
            ' 8 + 2
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1))
        Else
            ' 9 + 1
            getArrayPrimitiveValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0))
        End If
    End If
End Function

' 从多维数组中获取指定索引下的对象类型数据
' ！！！最多支持 10 维矩阵 ！！！
' 当前方法专门用来处理前一个方法接受了 paramArray 参数并需要获取数据的情况, 如:
'    f(arr, indexes, 3,4)
'
'    Sub f(ByRef arr As Variant, ByRef indexes As Variant, ParamArray ps() As Variant)
'        ' 调用该方法，以使得 ps 可以作为参数进行传递
'        Dim result As String
'        newArray = UtilsArray.getArrayObjValueByIndexArrayForParamsVal(arr, indexes, ps)
'    End Sub
'
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @param others 额外附加的子级维度的数据索引（用来接收前一个方法的 paramArray 参数）
' @return 指定索引下的数据
Public Function getArrayObjValueByIndexArrayForParamsVal(ByRef arr As Variant, _
    ByRef indexes As Variant, ByVal others As Variant) As Variant
    ' 1. 计算 others 的数量
    Dim otherSize As Integer
    otherSize = UBound(others) + 1

    ' 2. 如果 others 的数量为 0 ，则直接通过 indexes 来获取
    If otherSize = 0 Then
        Set getArrayObjValueByIndexArrayForParamsVal = getArrayObjValueByIndexArray(arr, indexes)
        Exit Function
    End If

    ' 3. 计算 indexes 的长度
    Dim mainMin As Integer
    Dim mainMax As Integer
    Dim mainSize As Integer
    mainMin = LBound(indexes)
    mainMax = UBound(indexes)
    mainSize = mainMax - mainMin + 1

    ' 4. 如果 indexes 的数量为 0 ，则直接通过 others 来获取
    If otherSize = 0 Then
        Set getArrayObjValueByIndexArrayForParamsVal = getArrayObjValueByParamsVal(arr, others)
        Exit Function
    End If

    ' 5. 按照不同的索引数量组合方式来从数组中获取数据
    ' indexes + other 将会产生的组合
    '   索引数量 = indexes的数量 + other的数量
    '    2 = 1 + 1 --> 只有这一种情况，不需要再进行逻辑拆分
    '    3 = 1 + 2, 2 + 1
    '    4 = 1 + 3, 2 + 2, 3 + 1
    '    5 = 1 + 4, 2 + 3, 3 + 2, 4 + 1
    '    6 = 1 + 5, 2 + 4, 3 + 3, 4 + 2, 5 + 1
    '    7 = 1 + 6, 2 + 5, 3 + 4, 4 + 3, 5 + 2, 6 + 1
    '    8 = 1 + 7, 2 + 6, 3 + 5, 4 + 4, 5 + 3, 6 + 2, 7 + 1
    '    9 = 1 + 8, 2 + 7, 3 + 6, 4 + 5, 5 + 4, 6 + 3, 7 + 2, 8 + 1
    '   10 = 1 + 9, 2 + 8, 3 + 7, 4 + 6, 5 + 5, 6 + 4, 7 + 3, 8 + 2, 9 + 1
    '
    ' 对于所有 X = 0 + X 的情况由前面的第 4 步处理
    ' 对于所有 X = X + 0 的情况由前面的第 2 步处理

    Dim size As Integer
    size = mainSize + otherSize

    If size = 2 Then
        ' 2 维
        On Error GoTo catchD2:
        Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0))
        Exit Function
catchD2:
        If IsEmpty(arr(indexes(mainMin), others(0))) Then
            ' 处理空数据的情况
            Set getArrayObjValueByIndexArrayForParamsVal = Nothing
        Else
            ' 如果是其他异常继续抛出
            Err.Raise Err.Number, Description:=Err.Description
        End If
    ElseIf size = 3 Then
        ' 3 维
        If mainSize = 1 And otherSize = 2 Then
            ' 1 + 2
            On Error GoTo catchD3For12:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1))
            Exit Function
catchD3For12:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 2 + 1
            On Error GoTo catchD3For21:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0))
            Exit Function
catchD3For21:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 4 Then
        ' 4 维
        If mainSize = 1 And otherSize = 3 Then
            ' 1 + 3
            On Error GoTo catchD4For13:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2))
            Exit Function
catchD4For13:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 2 Then
            ' 2 + 2
            On Error GoTo catchD4For22:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1))
            Exit Function
catchD4For22:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 3 + 1
            On Error GoTo catchD4For31:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0))
            Exit Function
catchD4For31:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 5 Then
        ' 5 维
        If mainSize = 1 And otherSize = 4 Then
            ' 1 + 4
            On Error GoTo catchD5For14:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3))
            Exit Function
catchD5For14:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 3 Then
            ' 2 + 3
            On Error GoTo catchD5For23:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2))
            Exit Function
catchD5For23:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 2 Then
            ' 3 + 2
            On Error GoTo catchD5For32:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1))
            Exit Function
catchD5For32:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 4 + 1
            On Error GoTo catchD5For41:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0))
            Exit Function
catchD5For41:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 6 Then
        ' 6 维
        If mainSize = 1 And otherSize = 5 Then
            ' 1 + 5
            On Error GoTo catchD6For15:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD6For15:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 4 Then
            ' 2 + 4
            On Error GoTo catchD6For24:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3))
            Exit Function
catchD6For24:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 3 Then
            ' 3 + 3
            On Error GoTo catchD6For33:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2))
            Exit Function
catchD6For33:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 4 And otherSize = 2 Then
            ' 4 + 2
            On Error GoTo catchD6For42:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1))
            Exit Function
catchD6For42:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 5 + 1
            On Error GoTo catchD6For51:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0))
            Exit Function
catchD6For51:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 7 Then
        ' 7 维
        If mainSize = 1 And otherSize = 6 Then
            ' 1 + 6
            On Error GoTo catchD7For16:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD7For16:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 5 Then
            ' 2 + 5
            On Error GoTo catchD7For25:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD7For25:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 4 Then
            ' 3 + 4
            On Error GoTo catchD7For34:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3))
            Exit Function
catchD7For34:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 4 And otherSize = 3 Then
            ' 4 + 3
            On Error GoTo catchD7For43:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2))
            Exit Function
catchD7For43:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 5 And otherSize = 2 Then
            ' 5 + 2
            On Error GoTo catchD7For52:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1))
            Exit Function
catchD7For52:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 6 + 1
            On Error GoTo catchD7For61:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0))
            Exit Function
catchD7For61:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 8 Then
        ' 8 维
        If mainSize = 1 And otherSize = 7 Then
            ' 1 + 7
            On Error GoTo catchD8For17:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD8For17:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 6 Then
            ' 2 + 6
            On Error GoTo catchD8For26:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD8For26:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 5 Then
            ' 3 + 5
            On Error GoTo catchD8For35:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD8For35:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 4 And otherSize = 4 Then
            ' 4 + 4
            On Error GoTo catchD8For44:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3))
            Exit Function
catchD8For44:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 5 And otherSize = 3 Then
            ' 5 + 3
            On Error GoTo catchD8For53:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2))
            Exit Function
catchD8For53:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 6 And otherSize = 2 Then
            ' 6 + 2
            On Error GoTo catchD8For62:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1))
            Exit Function
catchD8For62:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 7 + 1
            On Error GoTo catchD8For71:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0))
            Exit Function
catchD8For71:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 9 Then
        ' 9 维
        If mainSize = 1 And otherSize = 8 Then
            ' 1 + 8
            On Error GoTo catchD9For18:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
            Exit Function
catchD9For18:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 7 Then
            ' 2 + 7
            On Error GoTo catchD9For27:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD9For27:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 6 Then
            ' 3 + 6
            On Error GoTo catchD9For36:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD9For36:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 4 And otherSize = 5 Then
            ' 4 + 5
            On Error GoTo catchD9For45:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD9For45:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 5 And otherSize = 4 Then
            ' 5 + 4
            On Error GoTo catchD9For54:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3))
            Exit Function
catchD9For54:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 6 And otherSize = 3 Then
            ' 6 + 3
            On Error GoTo catchD9For63:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2))
            Exit Function
catchD9For63:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 7 And otherSize = 2 Then
            ' 7 + 2
            On Error GoTo catchD9For72:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1))
            Exit Function
catchD9For72:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 8 + 1
            On Error GoTo catchD9For81:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0))
            Exit Function
catchD9For81:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    ElseIf size = 10 Then
        ' 10 维
        If mainSize = 1 And otherSize = 9 Then
            ' 1 + 9
            On Error GoTo catchD10For19:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8))
            Exit Function
catchD10For19:
            If IsEmpty(arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 2 And otherSize = 8 Then
            ' 2 + 8
            On Error GoTo catchD10For28:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))
            Exit Function
catchD10For28:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 3 And otherSize = 7 Then
            ' 3 + 7
            On Error GoTo catchD10For37:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6))
            Exit Function
catchD10For37:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 4 And otherSize = 6 Then
            ' 4 + 6
            On Error GoTo catchD10For46:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5))
            Exit Function
catchD10For46:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 5 And otherSize = 5 Then
            ' 5 + 5
            On Error GoTo catchD10For55:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4))
            Exit Function
catchD10For55:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 6 And otherSize = 4 Then
            ' 6 + 4
            On Error GoTo catchD10For64:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3))
            Exit Function
catchD10For64:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 7 And otherSize = 3 Then
            ' 7 + 3
            On Error GoTo catchD10For73:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2))
            Exit Function
catchD10For73:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        ElseIf mainSize = 8 And otherSize = 2 Then
            ' 8 + 2
            On Error GoTo catchD10For82:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1))
            Exit Function
catchD10For82:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        Else
            ' 9 + 1
            On Error GoTo catchD10For91:
            Set getArrayObjValueByIndexArrayForParamsVal = arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0))
            Exit Function
catchD10For91:
            If IsEmpty(arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0))) Then
                ' 处理空数据的情况
                Set getArrayObjValueByIndexArrayForParamsVal = Nothing
            Else
                ' 如果是其他异常继续抛出
                Err.Raise Err.Number, Description:=Err.Description
            End If
        End If
    End If
End Function

'-----------------------------------------
' 设置多维数组中的数据
'-----------------------------------------
' 按照指定的多维数组索引来设置数据
' ！！！最多支持 10 维矩阵 ！！！
'
' 不会委托调用 setArrayValueByIndexArrayForParamsVal 方法来处理，以防止 ParamArray 参数产生的复制行为
'
' @param val 需要设置的数据
' @param arr 数据数组
' @param-array indexes 各维度的数据索引
Public Sub setArrayValueByParams(ByRef val As Variant, ByRef arr As Variant, ParamArray indexes() As Variant)
    Dim deminsionCount As Integer
    deminsionCount = UBound(indexes) + 1
    If deminsionCount = 1 Then
        ' 1 维
        If IsObject(val) Then
            Set arr(indexes(0)) = val
        Else
            arr(indexes(0)) = val
        End If
    ElseIf deminsionCount = 2 Then
        ' 2 维
        If IsObject(val) Then
            Set arr(indexes(0), indexes(1)) = val
        Else
            arr(indexes(0), indexes(1)) = val
        End If
    ElseIf deminsionCount = 3 Then
        ' 3 维
        If IsObject(val) Then
            Set arr(indexes(0), indexes(1), indexes(2)) = val
        Else
            arr(indexes(0), indexes(1), indexes(2)) = val
        End If
    ElseIf deminsionCount = 4 Then
        ' 4 维
        If IsObject(val) Then
            Set arr(indexes(0), indexes(1), indexes(2), indexes(3)) = val
        Else
            arr(indexes(0), indexes(1), indexes(2), indexes(3)) = val
        End If
    ElseIf deminsionCount = 5 Then
        ' 5 维
        If IsObject(val) Then
            Set arr(indexes(0), indexes(01), indexes(2), indexes(3), indexes(4)) = val
        Else
            arr(indexes(0), indexes(01), indexes(2), indexes(3), indexes(4)) = val
        End If
    ElseIf deminsionCount = 6 Then
        ' 6 维
        If IsObject(val) Then
            Set arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5)) = val
        Else
            arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5)) = val
        End If
    ElseIf deminsionCount = 7 Then
        ' 7 维
        If IsObject(val) Then
            Set arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6)) = val
        Else
            arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6)) = val
        End If
    ElseIf deminsionCount = 8 Then
        ' 8 维
        If IsObject(val) Then
            Set arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7)) = val
        Else
            arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7)) = val
        End If
    ElseIf deminsionCount = 9 Then
        ' 9 维
        If IsObject(val) Then
            Set arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8)) = val
        Else
            arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8)) = val
        End If
    ElseIf deminsionCount = 10 Then
        ' 10 维
        If IsObject(val) Then
            Set arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8), indexes(9)) = val
        Else
            arr(indexes(0), indexes(1), indexes(2), indexes(3), indexes(4), indexes(5), indexes(6), indexes(7), indexes(8), indexes(9)) = val
        End If
    End If
End Sub

' 按照指定的多维数组索引来设置数据
' ！！！最多支持 10 维矩阵 ！！！
'
' 当前方法专门用来处理前一个方法接受了 paramArray 参数并需要设置数据的情况, 如:
'   f(val, arr, 1,2,3,4)
'
'   Sub f(ByRef val As Variant, ByRef arr As Variant, ParamArray ps() As Variant)
'       ' 调用该方法，以使得 ps 可以作为参数进行传递
'       Dim result As Variant
'       newArray = UtilsArray.setArrayValueByParamsVal(val, arr, ps)
'   End Sub
'
' @param val 需要设置的数据
' @param arr 数据数组
' @param indexes 各维度的数据索引（用来接收前一个方法的 paramArray 参数）
Public Sub setArrayValueByParamsVal(ByRef val As Variant, ByRef arr As Variant, ByVal indexes As Variant)
    setArrayValueByIndexArray val, arr, indexes
End Sub

' 按照指定的多维数组索引来设置数据
' ！！！最多支持 10 维矩阵 ！！！
' @param val 需要设置的数据
' @param arr 数据数组
' @param indexes 各维度的数据索引
Public Sub setArrayValueByIndexArray(ByRef val As Variant, ByRef arr As Variant, ByRef indexes As Variant)
    Dim deminsionCount As Integer
    Dim min As Integer
    min = LBound(indexes)
    deminsionCount = UBound(indexes) - min + 1
    If deminsionCount = 1 Then
        ' 1 维
        If IsObject(val) Then
            Set arr(indexes(min)) = val
        Else
            arr(indexes(min)) = val
        End If
    ElseIf deminsionCount = 2 Then
        ' 2 维
        If IsObject(val) Then
            Set arr(indexes(min), indexes(min + 1)) = val
        Else
            arr(indexes(min), indexes(min + 1)) = val
        End If
    ElseIf deminsionCount = 3 Then
        ' 3 维
        If IsObject(val) Then
            Set arr(indexes(min), indexes(min + 1), indexes(min + 2)) = val
        Else
            arr(indexes(min), indexes(min + 1), indexes(min + 2)) = val
        End If
    ElseIf deminsionCount = 4 Then
        ' 4 维
        If IsObject(val) Then
            Set arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3)) = val
        Else
            arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3)) = val
        End If
    ElseIf deminsionCount = 5 Then
        ' 5 维
        If IsObject(val) Then
            Set arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4)) = val
        Else
            arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4)) = val
        End If
    ElseIf deminsionCount = 6 Then
        ' 6 维
        If IsObject(val) Then
            Set arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5)) = val
        Else
            arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5)) = val
        End If
    ElseIf deminsionCount = 7 Then
        ' 7 维
        If IsObject(val) Then
            Set arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6)) = val
        Else
            arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6)) = val
        End If
    ElseIf deminsionCount = 8 Then
        ' 8 维
        If IsObject(val) Then
            Set arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7)) = val
        Else
            arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7)) = val
        End If
    ElseIf deminsionCount = 9 Then
        ' 9 维
        If IsObject(val) Then
            Set arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8)) = val
        Else
            arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8)) = val
        End If
    ElseIf deminsionCount = 10 Then
        ' 10 维
        If IsObject(val) Then
            Set arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8), indexes(min + 9)) = val
        Else
            arr(indexes(min), indexes(min + 1), indexes(min + 2), indexes(min + 3), indexes(min + 4), indexes(min + 5), indexes(min + 6), indexes(min + 7), indexes(min + 8), indexes(min + 9)) = val
        End If
    End If
End Sub

' 按照指定的多维数组索引来设置数据
' ！！！最多支持 10 维矩阵 ！！！
'
' 这里不会委托调用 setArrayValueByIndexArrayForParamsVal 方法来完成，以防止 others 数组的复制
'
' @param val 需要设置的数据
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @param-array others 额外附加的子级维度的数据索引
Public Sub setArrayValueByIndexArrayForParams(ByRef val As Variant, ByRef arr As Variant, _
    ByRef indexes As Variant, ParamArray others() As Variant)
    ' 1. 计算 others 的数量
    Dim otherSize As Integer
    otherSize = UBound(others) + 1

    ' 2. 如果 others 的数量为 0 ，则直接通过 indexes 来获取
    If otherSize = 0 Then
        UtilsArray.setArrayValueByIndexArray val, arr, indexes
        Exit Sub
    End If

    ' 3. 计算 indexes 的长度
    Dim mainMin As Integer
    Dim mainMax As Integer
    Dim mainSize As Integer
    mainMin = LBound(indexes)
    mainMax = UBound(indexes)
    mainSize = mainMax - mainMin + 1

    ' 4. 如果 indexes 的数量为 0 ，则直接通过 others 来获取
    If otherSize = 0 Then
        UtilsArray.setArrayValueByParamsVal val, arr, others
        Exit Sub
    End If

    ' 5. 按照不同的索引数量组合方式来从数组中获取数据
    ' indexes + other 将会产生的组合
    '   索引数量 = indexes的数量 + other的数量
    '    2 = 1 + 1 --> 只有这一种情况，不需要再进行逻辑拆分
    '    3 = 1 + 2, 2 + 1
    '    4 = 1 + 3, 2 + 2, 3 + 1
    '    5 = 1 + 4, 2 + 3, 3 + 2, 4 + 1
    '    6 = 1 + 5, 2 + 4, 3 + 3, 4 + 2, 5 + 1
    '    7 = 1 + 6, 2 + 5, 3 + 4, 4 + 3, 5 + 2, 6 + 1
    '    8 = 1 + 7, 2 + 6, 3 + 5, 4 + 4, 5 + 3, 6 + 2, 7 + 1
    '    9 = 1 + 8, 2 + 7, 3 + 6, 4 + 5, 5 + 4, 6 + 3, 7 + 2, 8 + 1
    '   10 = 1 + 9, 2 + 8, 3 + 7, 4 + 6, 5 + 5, 6 + 4, 7 + 3, 8 + 2, 9 + 1
    '
    ' 对于所有 X = 0 + X 的情况由前面的第 4 步处理
    ' 对于所有 X = X + 0 的情况由前面的第 2 步处理

    Dim size As Integer
    size = mainSize + otherSize

    If size = 2 Then
        ' 2 维
        If IsObject(val) Then
            Set arr(indexes(mainMin), others(0)) = val
        Else
            arr(indexes(mainMin), others(0)) = val
        End If
    ElseIf size = 3 Then
        ' 3 维
        If mainSize = 1 And otherSize = 2 Then
            ' 1 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), others(0), others(1)) = val
            End If
        Else
            ' 2 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0)) = val
            End If
        End If
    ElseIf size = 4 Then
        ' 4 维
        If mainSize = 1 And otherSize = 3 Then
            ' 1 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 2 Then
            ' 2 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1)) = val
            End If
        Else
            ' 3 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0)) = val
            End If
        End If
    ElseIf size = 5 Then
        ' 5 维
        If mainSize = 1 And otherSize = 4 Then
            ' 1 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 3 Then
            ' 2 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 2 Then
            ' 3 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1)) = val
            End If
        Else
            ' 4 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0)) = val
            End If
        End If
    ElseIf size = 6 Then
        ' 6 维
        If mainSize = 1 And otherSize = 5 Then
            ' 1 + 5
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 4 Then
            ' 2 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 3 Then
            ' 3 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 4 And otherSize = 2 Then
            ' 4 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1)) = val
            End If
        Else
            ' 5 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0)) = val
            End If
        End If
    ElseIf size = 7 Then
        ' 7 维
        If mainSize = 1 And otherSize = 6 Then
            ' 1 + 6
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 5 Then
            ' 2 + 5
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 4 Then
            ' 3 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 4 And otherSize = 3 Then
            ' 4 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 5 And otherSize = 2 Then
            ' 5 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1)) = val
            End If
        Else
            ' 6 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0)) = val
            End If
        End If
    ElseIf size = 8 Then
        ' 8 维
        If mainSize = 1 And otherSize = 7 Then
            ' 1 + 7
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 6 Then
            ' 2 + 6
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 5 Then
            ' 3 + 5
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4)) = val
            End If
        ElseIf mainSize = 4 And otherSize = 4 Then
            ' 4 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 5 And otherSize = 3 Then
            ' 5 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 6 And otherSize = 2 Then
            ' 6 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1)) = val
            End If
        Else
            ' 7 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0)) = val
            Else
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0)) = val
            End If
        End If
    ElseIf size = 9 Then
        ' 9 维
        If mainSize = 1 And otherSize = 8 Then
            ' 1 + 8
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 7 Then
            ' 2 + 7
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 6 Then
            ' 3 + 6
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            End If
        ElseIf mainSize = 4 And otherSize = 5 Then
            ' 4 + 5
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4)) = val
            End If
        ElseIf mainSize = 5 And otherSize = 4 Then
            ' 5 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 6 And otherSize = 3 Then
            ' 6 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 7 And otherSize = 2 Then
            ' 7 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1)) = val
            End If
        Else
            ' 8 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0)) = val
            End If
        End If
    ElseIf size = 10 Then
        ' 10 维
        If mainSize = 1 And otherSize = 9 Then
            ' 1 + 9
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 8 Then
            ' 2 + 8
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 7 Then
            ' 3 + 7
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            End If
        ElseIf mainSize = 4 And otherSize = 6 Then
            ' 4 + 6
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            End If
        ElseIf mainSize = 5 And otherSize = 5 Then
            ' 5 + 5
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4)) = val
            End If
        ElseIf mainSize = 6 And otherSize = 4 Then
            ' 6 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 7 And otherSize = 3 Then
            ' 7 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 8 And otherSize = 2 Then
            ' 8 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1)) = val
            End If
        Else
            ' 9 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0)) = val
            End If
        End If
    End If
End Sub

' 按照指定的多维数组索引来设置数据
' ！！！最多支持 10 维矩阵 ！！！
' 当前方法专门用来处理前一个方法接受了 paramArray 参数并需要设置数据的情况, 如:
'    f("abc", arr, indexes, 3,4)
'
'    Sub f(ByRef val As Variant, ByRef arr As Variant, ByRef indexes As Variant, ParamArray ps() As Variant)
'        ' 调用该方法，以使得 ps 可以作为参数进行传递
'        UtilsArray.setArrayValueByIndexArrayForParamsVal val, arr, indexes, ps
'    End Sub
'
' @param val 需要设置的数据
' @param arr 数据数组
' @param indexes 各维度的数据索引
' @param others 额外附加的子级维度的数据索引（用来接收前一个方法的 paramArray 参数）
Public Sub setArrayValueByIndexArrayForParamsVal(ByRef val As Variant, ByRef arr As Variant, _
    ByRef indexes As Variant, ByVal others As Variant)
    ' 1. 计算 others 的数量
    Dim otherSize As Integer
    otherSize = UBound(others) + 1

    ' 2. 如果 others 的数量为 0 ，则直接通过 indexes 来获取
    If otherSize = 0 Then
        UtilsArray.setArrayValueByIndexArray val, arr, indexes
        Exit Sub
    End If

    ' 3. 计算 indexes 的长度
    Dim mainMin As Integer
    Dim mainMax As Integer
    Dim mainSize As Integer
    mainMin = LBound(indexes)
    mainMax = UBound(indexes)
    mainSize = mainMax - mainMin + 1

    ' 4. 如果 indexes 的数量为 0 ，则直接通过 others 来获取
    If otherSize = 0 Then
        UtilsArray.setArrayValueByParamsVal val, arr, others
        Exit Sub
    End If

    ' 5. 按照不同的索引数量组合方式来从数组中获取数据
    ' indexes + other 将会产生的组合
    '   索引数量 = indexes的数量 + other的数量
    '    2 = 1 + 1 --> 只有这一种情况，不需要再进行逻辑拆分
    '    3 = 1 + 2, 2 + 1
    '    4 = 1 + 3, 2 + 2, 3 + 1
    '    5 = 1 + 4, 2 + 3, 3 + 2, 4 + 1
    '    6 = 1 + 5, 2 + 4, 3 + 3, 4 + 2, 5 + 1
    '    7 = 1 + 6, 2 + 5, 3 + 4, 4 + 3, 5 + 2, 6 + 1
    '    8 = 1 + 7, 2 + 6, 3 + 5, 4 + 4, 5 + 3, 6 + 2, 7 + 1
    '    9 = 1 + 8, 2 + 7, 3 + 6, 4 + 5, 5 + 4, 6 + 3, 7 + 2, 8 + 1
    '   10 = 1 + 9, 2 + 8, 3 + 7, 4 + 6, 5 + 5, 6 + 4, 7 + 3, 8 + 2, 9 + 1
    '
    ' 对于所有 X = 0 + X 的情况由前面的第 4 步处理
    ' 对于所有 X = X + 0 的情况由前面的第 2 步处理

    Dim size As Integer
    size = mainSize + otherSize

    If size = 2 Then
        ' 2 维
        If IsObject(val) Then
            Set arr(indexes(mainMin), others(0)) = val
        Else
            arr(indexes(mainMin), others(0)) = val
        End If
    ElseIf size = 3 Then
        ' 3 维
        If mainSize = 1 And otherSize = 2 Then
            ' 1 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), others(0), others(1)) = val
            End If
        Else
            ' 2 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0)) = val
            End If
        End If
    ElseIf size = 4 Then
        ' 4 维
        If mainSize = 1 And otherSize = 3 Then
            ' 1 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 2 Then
            ' 2 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1)) = val
            End If
        Else
            ' 3 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0)) = val
            End If
        End If
    ElseIf size = 5 Then
        ' 5 维
        If mainSize = 1 And otherSize = 4 Then
            ' 1 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 3 Then
            ' 2 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 2 Then
            ' 3 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1)) = val
            End If
        Else
            ' 4 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0)) = val
            End If
        End If
    ElseIf size = 6 Then
        ' 6 维
        If mainSize = 1 And otherSize = 5 Then
            ' 1 + 5
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 4 Then
            ' 2 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 3 Then
            ' 3 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 4 And otherSize = 2 Then
            ' 4 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1)) = val
            End If
        Else
            ' 5 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0)) = val
            End If
        End If
    ElseIf size = 7 Then
        ' 7 维
        If mainSize = 1 And otherSize = 6 Then
            ' 1 + 6
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 5 Then
            ' 2 + 5
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 4 Then
            ' 3 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 4 And otherSize = 3 Then
            ' 4 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 5 And otherSize = 2 Then
            ' 5 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1)) = val
            End If
        Else
            ' 6 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0)) = val
            End If
        End If
    ElseIf size = 8 Then
        ' 8 维
        If mainSize = 1 And otherSize = 7 Then
            ' 1 + 7
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 6 Then
            ' 2 + 6
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 5 Then
            ' 3 + 5
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4)) = val
            End If
        ElseIf mainSize = 4 And otherSize = 4 Then
            ' 4 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 5 And otherSize = 3 Then
            ' 5 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 6 And otherSize = 2 Then
            ' 6 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1)) = val
            End If
        Else
            ' 7 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0)) = val
            End If
        End If
    ElseIf size = 9 Then
        ' 9 维
        If mainSize = 1 And otherSize = 8 Then
            ' 1 + 8
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 7 Then
            ' 2 + 7
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 6 Then
            ' 3 + 6
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            End If
        ElseIf mainSize = 4 And otherSize = 5 Then
            ' 4 + 5
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4)) = val
            End If
        ElseIf mainSize = 5 And otherSize = 4 Then
            ' 5 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 6 And otherSize = 3 Then
            ' 6 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 7 And otherSize = 2 Then
            ' 7 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1)) = val
            End If
        Else
            ' 8 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0)) = val
            End If
        End If
    ElseIf size = 10 Then
        ' 10 维
        If mainSize = 1 And otherSize = 9 Then
            ' 1 + 9
            If IsObject(val) Then
                Set arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8)) = val
            Else
                arr(indexes(mainMin), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7), others(8)) = val
            End If
        ElseIf mainSize = 2 And otherSize = 8 Then
            ' 2 + 8
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), others(0), others(1), others(2), others(3), others(4), others(5), others(6), others(7)) = val
            End If
        ElseIf mainSize = 3 And otherSize = 7 Then
            ' 3 + 7
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), others(0), others(1), others(2), others(3), others(4), others(5), others(6)) = val
            End If
        ElseIf mainSize = 4 And otherSize = 6 Then
            ' 4 + 6
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), others(0), others(1), others(2), others(3), others(4), others(5)) = val
            End If
        ElseIf mainSize = 5 And otherSize = 5 Then
            ' 5 + 5
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), others(0), others(1), others(2), others(3), others(4)) = val
            End If
        ElseIf mainSize = 6 And otherSize = 4 Then
            ' 6 + 4
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), others(0), others(1), others(2), others(3)) = val
            End If
        ElseIf mainSize = 7 And otherSize = 3 Then
            ' 7 + 3
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), others(0), others(1), others(2)) = val
            End If
        ElseIf mainSize = 8 And otherSize = 2 Then
            ' 8 + 2
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), others(0), others(1)) = val
            End If
        Else
            ' 9 + 1
            If IsObject(val) Then
                Set arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0)) = val
            Else
                arr(indexes(mainMin), indexes(mainMin + 1), indexes(mainMin + 2), indexes(mainMin + 3), indexes(mainMin + 4), indexes(mainMin + 5), indexes(mainMin + 6), indexes(mainMin + 7), indexes(mainMin + 8), others(0)) = val
            End If
        End If
    End If
End Sub
